Here are the SQL queries to insert single-row and multiple rows. The insert command with values you usually insert single row into the table. Similarly, you can insert multiple rows.
INSERT SQL Query
INSERT INTO MY_TABLE VALUES(‘RAMA’, 20000, ‘HYDERABAD’, 1001);
The my_table let us say has four columns. Those are Name, Salary, City and EmpCode. The way of insert with single line of values is called single-row insert.
And you can insert NULL value into a table. The optional thing is you can avoid the column names, if the values are in the same order of Table columns.
INSERT INTO MY_TABLE (Name, Salary, City, EmpCode) VALUES('RAMA', 20000, 'HYDERABAD', 1001);
Inserting multi-rows saves your time, and you can avoid Values keyword multiple times of writing.
After each value line you need to use comma ‘,’. The semi-colon just use only once (at the end of SQL query).
INSERT INTO MY_TABLE (Name, Salary, City, EmpCode) VALUES('RAMA', 20000, 'HYDERABAD', 1001), ('RAVI', 30000, 'DELHI', 1002), ('RANI', 40000, 'LUKNOW', 1003);