Insert Data Into Database Using SQL. The following SQL commands show how to insert data into the database using SQL.
SQL INSERT INTO Syntax:
INSERT INTO table_name
VALUES (value, value, value, ...);
Example:
INSERT INTO employees
VALUES (NULL, 'Cardinal', 'cardinal@gmail.com', ‘male', 350, 'Dhaka', 'Bangladesh');
INSERT INTO table_name (column, column, column, ...)
VALUES (value, value, value, ...);
Example:
INSERT INTO employees (name, email, gender, salary, city, country)
VALUES ('Cardinal', 'cardinal@gmail.com', ‘male', 3500, 'Dhaka', 'Bangladesh');
Insert Data Only in Specified Columns:
INSERT INTO employees (name, city, country)
VALUES ('Cardinal', 'Stavanger', 'Norway');