Useful SQL Commands

INSERT

Insert command is used to insert new data into a database table.

INSERT INTO table_name(column1, column2)
VALUES(value1, value2)

UPDATE

Update command modifies existing data in a database table.

UPDATE table_name
SET column1 = value1
WHERE condition

CREATE

Create command creates a new database table, and it allows to define the structure, like data type and columns.

CREATE TABLE table_name (
column1 datatype
column2 datatype
)

ALTER

Alter command is used to modify the structure of a database object.

ALTER TABLE table_name
ADD column_name datatype

Truncate

The truncate command deletes all data from a table while keeping its structure the same.

TRUNCATE TABLE table_name