INSERT INTO Statement in SQL
INSERT INTO Statement in SQL
The INSERT INTO statement in SQL is used to add new records into a table. It is one of the most frequently used commands in SQL because every database application requires inserting new data.
In this beginner-friendly SQL tutorial, you will learn:
What INSERT INTO does
Syntax of INSERT INTO
Insert single row
Insert multiple rows
Insert data into selected columns
Insert using SELECT
Real-world examples
Best practices

The INSERT INTO statement adds new rows to a database table.
Two main ways to use INSERT:
Insert into all columns
Insert into specific columns
INSERT INTO table_name
VALUES (value1, value2, value3, ...);
INSERT INTO table_name (column1, column2, column3)
VALUES (value1, value2, value3);
| id | name | city | |
|---|---|---|---|
| 1 | Amit | [email protected] | Delhi |
| 2 | Neha | [email protected] | Mumbai |
INSERT INTO users (name, email, city)
VALUES ('Rahul', '[email protected]', 'Bengaluru');
(Useful only if you know the correct order of columns.)
INSERT INTO users
VALUES (3, 'Sara', '[email protected]', 'Pune');
INSERT INTO users (name, email, city)
VALUES
('Karan', '[email protected]', 'Delhi'),
('Megha', '[email protected]', 'Hyderabad'),
('Ravi', '[email protected]', 'Kolkata');
If a column has a default value:
INSERT INTO users (name, email)
VALUES ('Shubham', '[email protected]');
The city column will use its default value.
You can insert data from one table into another.
INSERT INTO backup_users (name, email, city)
SELECT name, email, city
FROM users
WHERE city = 'Delhi';
This copies selected users into another table.
INSERT INTO users (name, email, city)
VALUES ('Unknown', NULL, 'Unknown');
INSERT INTO users (name, email, password)
VALUES ('John Doe', '[email protected]', 'hashed_pass');
INSERT INTO products (product_name, price, stock)
VALUES ('Laptop', 55000, 10);
INSERT INTO orders (user_id, product, amount)
VALUES (1, 'Mobile', 20000);
INSERT INTO users VALUES ('Amit', '[email protected]');
Fix: Match number of table columns OR specify column names.
INSERT INTO employees (salary)
VALUES ('abc'); -- wrong
Fix: Insert valid numeric values.
✔ Always specify column names
✔ Use multiple-row inserts for better performance
✔ Avoid inserting hardcoded IDs when using AUTO_INCREMENT
✔ Validate data before inserting
✔ Use transactions for bulk inserts
In this SQL INSERT INTO tutorial, you learned:
How to insert data into tables
Insert single/multiple rows
Insert into specific columns
Insert using SELECT
Common errors and best practices
INSERT INTO is one of the most essential SQL commands for working with any database-driven application.