- Trending Categories
- 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
How can we insert a new row into a MySQL table?
With the help of INSERT INTO command, a new row can be inserted into a table.
Syntax
INSERT INTO table_name values(value1,value2,…)
Example
Suppose we have a table named ‘Employee’ with three columns ‘Emp_id’, ‘Emp_name’ and ‘Emp_Sal’ then with the help of following query we can add new rows to the table −
mysql> INSERT INTO Employee values(110,'Aarav',50000); Query OK, 1 row affected (0.07 sec) mysql> INSERT INTO Employee values(200,'Raman',28000); Query OK, 1 row affected (0.10 sec) mysql> Select * from Employee; +---------+-------------+-----------+ | Emp_id | Emp_name | Emp_sal | +---------+-------------+-----------+ | 110 |Aarav | 50000 | | 200 | Raman | 28000 | +---------+-------------+-----------+ 2 rows in set (0.00 sec)
Advertisements