![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 4219 Articles for MySQLi
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
21K+ Views
The error-#1046 can occur when we are creating a table, but forget to select the database. Let us say we have started MySQL as shown below −After giving the correct password, the above window will open. Now create a table without choosing any database. This will show an error −mysql> CREATE table TblUni -> ( -> id int, -> Name varchar(100) -> );ERROR 1046 (3D000): No database selectedThe following screenshot is showing the same error −Now, choose any database to get rid of the above error. Firstly, let us check how many databases are present in MySQL with the help ... Read More
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
536 Views
The backup of a table can be made with the help of backup table as well as mysqldump utility. The backup table concept was used in MySQL version 5.0 and its earlier version. Here, I am performing backup with the help of mysqldump. Firstly, we will open cmd with the help of shortcut key. The mysqldump will run at the cmd. Therefore, firstly open cmd with the help of shortcut key − windowskey+R; Here is the snapshot − Now, cmd will open − In this, the MySQL bin folder is present at the following location − ... Read More
![Paul Richard](https://www.tutorialspoint.com/assets/profiles/13505/profile/60_52698-1512536733.jpg)
194 Views
It is quite possible to add multiple virtual generated columns in a MySQL table. It can be illustrated with the following example as follows −Examplemysql> Create table profit(cost int, price int, profit int AS (price-cost), price_revised int AS (price-2)); Query OK, 0 rows affected (0.73 sec) mysql> Describe profit; +---------------+---------+------+-----+---------+-------------------+ | Field | Type | Null | Key | Default | Extra | +---------------+---------+------+-----+---------+-------------------+ | cost | int(11) | YES | | NULL | ... Read More
![Chandu yadav](https://www.tutorialspoint.com/assets/profiles/22330/profile/60_142811-1519038104.jpg)
91 Views
It is quite possible to add multiple stored generated columns in a MySQL table. It can be illustrated with the following example as follows −Examplemysql> Create table profit1(cost int, price int, profit int AS (price-cost) STORED, price_revised int AS (price-2) STORED); Query OK, 0 rows affected (0.36 sec) mysql> Describe profit1; +---------------+---------+------+-----+---------+------------------+ | Field | Type | Null | Key | Default | Extra | +---------------+---------+------+-----+---------+------------------+ | cost | int(11) | YES | | NULL | ... Read More
![Sharon Christine](https://www.tutorialspoint.com/assets/profiles/13517/profile/60_82215-1512649681.jpg)
130 Views
For adding MySQL stored GENERATED COLUMNS in a table, we can use the same syntax as adding a column just adding “AS(expression)” after the data type. Its syntax would be as follows −SyntaxALTER TABLE table_name ADD COLUMN column_name AS(expression)STORED;Examplemysql> ALTER TABLE employee_data_stored ADD COLUMN FULLName Varchar(200) AS (CONCAT_WS(" ", 'First_name', 'Last_name')) STORED; Query OK, 2 rows affected (1.23 sec) Records: 2 Duplicates: 0 Warnings: 0 mysql> Describe employee_data_stored; +------------+--------------+------+-----+---------+------------------+ | Field | Type | Null | Key | Default | Extra | +------------+--------------+------+-----+---------+------------------+ | ID ... Read More
![Fendadis John](https://www.tutorialspoint.com/assets/profiles/13534/profile/60_64028-1512539837.jpg)
548 Views
Followings are some basic differences between MySQL stored GENERATED COLUMNS and MySQL virtual GENERATED COLUMNS −In terms of Disk SpaceIf we see the difference in terms of disk space then virtual generated columns would not take any disk space. On the other hand, the stored generated column would take disk space.In terms of operationIf we see the difference in terms of operation then virtual generated columns are INPLACE operations which means that the table definition is changed without having to recopy all the data again. On the other hand, stored generated columns are a copy operation and it has the ... Read More
![Chandu yadav](https://www.tutorialspoint.com/assets/profiles/22330/profile/60_142811-1519038104.jpg)
96 Views
It can be illustrated with the help of an example in which we are creating a stored generated column in the table named ‘employee_data_stored’. As we know that stored generated column can be generated by using the keyword ‘stored’.Examplemysql> Create table employee_data_stored(ID INT AUTO_INCREMENT PRIMARY KEY, First_name VARCHAR(50) NOT NULL, Last_name VARCHAR(50) NOT NULL, FULL_NAME VARCHAR(90) GENERATED ALWAYS AS(CONCAT(First_name, ' ', Last_name)) STORED); Query OK, 0 rows affected (0.52 sec) mysql> DESCRIBE employee_data_stored; +------------+-------------+------+-----+---------+------------------+ | Field | Type | Null | Key | Default | Extra | +------------+-------------+------+-----+---------+------------------+ | ... Read More
![Moumita](https://www.tutorialspoint.com/assets/profiles/13507/profile/60_122499-1557898491.jpg)
647 Views
For adding MySQL virtual GENERATED COLUMNS in a table, we can use the same syntax as adding a column just adding “AS(expression)” after the data type. Its syntax would be as follows −SyntaxALTER TABLE table_name ADD COLUMN column_name AS(expression);Examplemysql> ALTER TABLE employee_data ADD COLUMN FULLName Varchar(200) AS(CONCAT_WS(" ", 'First_name', 'Last_name')); Query OK, 0 rows affected (0.49 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> Describe employee_data; +------------+--------------+------+-----+---------+-------------------+ | Field | Type | Null | Key | Default | Extra | +------------+--------------+------+-----+---------+-------------------+ | ID ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
71 Views
It can be illustrated with the help of an example in which we are creating a stored generated column in the table named ‘triangle_stored’. As we know that stored generated column can be generated by using the keyword ‘stored’.Examplemysql> Create table triangle_stored(SideA DOUBLE, SideB DOUBLE, SideC DOUBLE AS (SQRT(SideA * SideB + SideB * SideB)) STORED); Query OK, 0 rows affected (0.47 sec) mysql> Describe triangle_stored; +-------+--------+------+-----+---------+------------------+ | Field | Type | Null | Key | Default | Extra | +-------+--------+------+-----+---------+------------------+ | SideA | double | YES | | NULL ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
101 Views
It can be illustrated with the help of an example in which we are creating a virtual generated column in the table named ‘triangle’. As we know that virtual generated column can be generated with or without using the keyword ‘virtual’.Examplemysql> Create table triangle(SideA DOUBLE, SideB DOUBLE, SideC DOUBLE AS (SQRT(SideA * SideB + SideB * SideB))); Query OK, 0 rows affected (0.44 sec) mysql> Describe Triangle; +-------+--------+------+-----+---------+-------------------+ | Field | Type | Null | Key | Default | Extra | +-------+--------+------+-----+---------+-------------------+ | SideA | double | YES | | ... Read More