← All languages
SQL keyword of the day
Random

INSERT

Add new rows into a table.

Description

The INSERT statement adds one or more new rows of data into a table. You can insert values explicitly by listing column names and corresponding values, or you can insert data from another table using a subquery. If column names are omitted, values must be provided for every column in the table in the order they are defined. INSERT is one of the fundamental data manipulation language (DML) statements in SQL.

Arguments

NameDescriptionOptional
table The name of the table to insert data into. No
columns The columns to insert values into. If omitted, values for all columns must be provided. Yes
values The values to insert, specified after the VALUES keyword. No

Example

INSERT INTO users (name, age) VALUES ('Alice', 30);
INSERT INTO logs (message) VALUES ('User logged in');