Syntax for inserting data

To INSERT a single row, you can use the following sample syntax:

INSERT INTO tablename (col1, col2, col3)
VALUES ('value1','value2',value3);

To INSERT multiple rows, you can use the following sample syntax:

INSERT INTO tablename (col1, col2, col3)
VALUES ('value1','value2',value3),
('value5','value6',value7),
('value8','value9',value10);

To create a table and insert data from another table into the new table, you can use the following sample syntax:

CREATE TABLE newtablename
SELECT * FROM existingtablename

To insert data from one table into another, you can use the following sample syntax:

INSERT INTO existingtable
SELECT * FROM anotherexistingtable
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.21.39.142