- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Environmental Science
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 to insert multiple rows in SQL ?
To insert multiple rows in SQL we can follow the below syntax:
INSERT INTO table_name (column1, column2,column3...)
VALUES
(value1, value2, value3…..),
(value1, value2, value3….),
...
(value1, value2, value3);
We start off by giving the keywords INSERT INTO then we give the name of the table into which we would want to insert the values. We will follow it up with the list of the columns, for which we would have to add the values. Then we will give in the VALUES keyword and finally, we will give the list of values.
Here is an example of the same:
INSERT INTO employees (
name,
age,
salary)
VALUES
(
'Sam',
21,
75000
),
(
' 'Matt',
32,
85000 ),
(
'Bob',
26,
90000
);
In the above example, we are inserting multiple records into the table called employees
- Related Questions & Answers
- What is MYSQL ?
- How to create a table in SQL ?
- How do I view tables in SQL ?
- What is SQL server ?
- What are Nested Triggers ?
- What is a unique key in SQL ?
- What is a schema in SQL ?
- What are the types of SQL Queries ?
- How to insert multiple rows in SQL ?
- How to delete a column in SQL ?
- How can I see all tables in SQL?
- What is OLTP ?
- How to delete a table in SQL ?
- What is a trigger in SQL ?
- What is Normalization in SQL ?
- What is OLAP ?
Advertisements
ads