Curriculum
Course: SQL
Login

Curriculum

SQL

SQL References

0/80

MySQL Functions

0/139

SQL Server Functions

0/84

SQL Quick Ref

0/1
Text lesson

INSERT INTO

INSERT INTO

The INSERT INTO command is utilized to add new rows to a table.

The following SQL statement inserts a new record into the “Customers” table:

Example

INSERT INTO Customers (CustomerName, ContactName, Address, City, PostalCode, Country)
VALUES (‘Cardinal’, ‘Tom B. Erichsen’, ‘Skagen 21’, ‘Stavanger’, ‘4006’, ‘Norway’);

The provided SQL will insert a new record, populating data solely in the “CustomerName”, “City”, and “Country” columns, with “CustomerID” automatically updated:

Example

INSERT INTO Customers (CustomerName, City, Country)
VALUES (‘Cardinal’, ‘Stavanger’, ‘Norway’);