Summary of Important SQL commands
| SELECT | extracts data from a DB |
| UPDATE | updates data in a DB |
| DELETE | deletes data from a DB |
| INSERT INTO | inserts new data into a DB |
| CREATE DATABASE | creates a new DB |
| ALTER DATABASE | modifies a DB |
| CREATE TABLE | creates a new table |
| ALTER TABLE | modifies a table |
| DROP TABLE | deletes a table |
| CREATE INDEX | creates an index (search key) |
| DROP INDEX | deletes an index |
UPDATE
used to change the existing records in a table
UPDATE table_name
SET col1 = val1, col2 = val2, ...
WHERE condition # The WHERE clause specifies which record(s) that should be updated.
# If you omit the WHERE clause, all records in the table will be updated.
Example

# Move the 2012 games from Londong to Paris
UPDATE games SET city='Paris'
WHERE yr = 2012
DELETE FROM
used to delete existing records in a table
DELETE FROM table_name
WHERE condition
Deleting ALL records:
DELETE FROM table_name
INSERT INTO
used to insert new records in a table
1. Specifying both the columns and the values to be inserted:
INSERT INTO table_name (col1, col2, col3, ...)
VALUES (val1, val2, val3, ...)
2. Specifying only the values (Adding values for all the columns of the table, and so the order of the values should be in the same order as the columns in the table):
INSERT INTO table_name
VALUES (val1, val2, val3, ...)