Beginner

704. INSERT INTO

Learn how to add new records into a database table using the INSERT INTO statement.

📘 Lesson 704 of 728 ⏱ 7 min 🎯 Beginner

INSERT INTO is a Data Manipulation Language (DML) command used to insert one or more records into a table. You can insert values into every column or specify only the required columns.

Databases become useful only when data is stored inside them. INSERT INTO is the primary command used to add new business records such as customers, employees, products, and orders.

When a new employee joins the company, HR inserts the employee's information into the Employees table.

SQL
INSERT INTO Employees
(
    EmployeeID,
    EmployeeName,
    Department,
    Salary
)
VALUES
(
    101,
    'Rahul Sharma',
    'IT',
    65000
);

Businesses use INSERT INTO to store customer registrations, employee details, online orders, bank transactions, inventory records, and many other types of operational data.

  • Adds new records into a table.
  • It is a DML command.
  • Column names should be specified whenever possible.
  • Values must match the column data types.
  • Multiple rows can also be inserted.
  • Supports inserting into selected columns.
  • Can insert data from another table.
Which SQL statement inserts new records into a table?

INSERT INTO is used to add new records into a database table.

Why should column names be specified in an INSERT statement?

Specifying column names makes the query easier to read and prevents errors if the table structure changes.

Have you finished this lesson?

Introduction to SQL – All Lessons