INSERT INTO
Syntax
Option 1: specify both the column names and the values to be inserted
INSERT INTO table_name (<column_name1>, <column_name2>, <column_name3> ...)
VALUES (<value1>, <value2>, <value3>, ...);Option 2: if inserting into all columns of the table, can omit the column names, but must ensure that the order of values listed is the same as the column order
Examples
#1
Insert a new record into the table:
Note: Did not need to insert a number in the CustomerID field, as it is an auto-increment field that will be automatically generated when a new record is inserted.
INSERT INTO Customers (CustomerName, ContactName, Address, City, PostalCode, Country)
VALUES ('Cardinal', 'Tom B. Erichsen', 'Skagen 21', 'Stavanger', '4006', 'Norway');#2
Insert new data into specific columns:
INSERT INTO Customers (CustomerName, Address, City, PostalCode, Country)
VALUES ('Hekkan Burger', 'Gateveien 15', 'Sandnes', '4306', 'Norway');References
Link to the tutorial: https://www.w3schools.com/sql/sql_insert.asp