INSERT
, UPDATE
, and DELETE
commands. Each of these operations has a different impact on the data inside your tables. Let’s take a look at the syntax of each of these statements.UPDATE table_name
SET column1 = value1,
column2 = value2,
…
[WHERE conditions]
SQL INSERT Syntax
You can write an INSERT
statement with or without explicitly declaring the column names. The syntax for using INSERT
without column names is:
INSERT INTO table_name
VALUES (value1, value2, value3, ...);
Note that you’ll need to provide a value for every column in the table if you omit the column names.
If you want to add data to some or all the columns in a table, use INSERT
with column names:
INSERT INTO table_name (column1, column2, column3, ...)
VALUES (value1, value2, value3, ...);
SQL DELETE Syntax
The syntax for using DELETE
is :
DELETE FROM table_name
[WHERE condition]