
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Multiple Data Input at the Same Time in MySQL
Following is the syntax −
insert into yourTableName values(yourValue1,yourValue2,.....N), (yourValue1,yourValue2,.....N), (yourValue1,yourValue2,.....N), (yourValue1,yourValue2,.....N), . . . N
Let us create a table −
mysql> create table demo56 −> ( −> id int, −> first_name varchar(20), −> last_name varchar(20), −> age int −> ); Query OK, 0 rows affected (1.91 sec)
Insert some records into the table with the help of insert command −
mysql> insert into demo56 values(1,'John','Smith',23), −> (2,'David','Miller',21), −> (3,'Chris','Brown',22), −> (4,'Carol','Taylor',20); Query OK, 4 rows affected (0.10 sec) Records: 4 Duplicates: 0 Warnings: 0
Display records from the table using select statement −
mysql> select *from demo56;
This will produce the following output −
+------+------------+-----------+------+ | id | first_name | last_name | age | +------+------------+-----------+------+ | 1 | John | Smith | 23 | | 2 | David | Miller | 21 | | 3 | Chris | Brown | 22 | | 4 | Carol | Taylor | 20 | +------+------------+-----------+------+ 4 rows in set (0.00 sec)
Advertisements