The table_name is the name of the table that you want to insert the rows into. The
column1, column2, column3, etc. are the names of the columns in the table that you want to insert data into. The
value1, value2, value3, etc. are the values that you want to insert into the columns.
For example, the following statement would insert a new row into the products table with the following values:
The product_id column is the primary key for the products table, so it must be unique. The
product_name and product_price columns are not constrained, so they can be repeated.
The INSERT INTO statement can also be used to insert multiple rows into a table at the same time. To do this, you can use a comma-separated list of values for the
VALUES clause. For example, the following statement would insert three new rows into the
products table:
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
Sure. The INSERT INTO statement in SQL is used to insert new rows into a table. The syntax for the INSERT INTO statement is as follows:
The
table_nameis the name of the table that you want to insert the rows into. Thecolumn1,column2,column3, etc. are the names of the columns in the table that you want to insert data into. Thevalue1,value2,value3, etc. are the values that you want to insert into the columns.For example, the following statement would insert a new row into the
productstable with the following values:The
product_idcolumn is the primary key for theproductstable, so it must be unique. Theproduct_nameandproduct_pricecolumns are not constrained, so they can be repeated.The
INSERT INTOstatement can also be used to insert multiple rows into a table at the same time. To do this, you can use a comma-separated list of values for theVALUESclause. For example, the following statement would insert three new rows into theproductstable: