
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
Insert Multiple Data Using SET Clause in MySQL
Let us first create a table −
mysql> create table DemoTable1544 -> ( -> Id int , -> Name varchar(20) -> ); Query OK, 0 rows affected (2.47 sec)
Insert some records in the table using insert command. We have inserted multiple data using SET clause −
mysql> insert into DemoTable1544 set Id=101,Name='John Doe'; Query OK, 1 row affected (0.19 sec) mysql> insert into DemoTable1544 set Id=102,Name='Adam Smith'; Query OK, 1 row affected (0.20 sec) mysql> insert into DemoTable1544 set Id=103,Name='Chris Brown'; Query OK, 1 row affected (0.12 sec)
Display all records from the table using select statement −
mysql> select * from DemoTable1544;
This will produce the following output −
+------+-------------+ | Id | Name | +------+-------------+ | 101 | John Doe | | 102 | Adam Smith | | 103 | Chris Brown | +------+-------------+ 3 rows in set (0.00 sec)
Advertisements