Cheatsheet: SQL
Basic operations
SELECT: Used to retrieve data from a database
INSERT: Used to insert new data into a database
UPDATE: Used to update existing data in a database
DELETE: Used to delete data from a database
WHERE: Used to filter results based on specific conditions
ORDER BY: Used to sort results in ascending or descending order
DELETE: Used to delete data from a database,
Data Definition Language
CREATE TABLE: Used to create a new table in a database.
ALTER TABLE: Used to modify the structure of an existing table
DROP TABLE: Used to delete a table from a database
Joins
INNER JOIN: Returns only the rows where there is a match in both tables
LEFT JOIN (or LEFT OUTER JOIN): Returns all the rows from the left table and the matching rows from the right table. If there is no match, NULL values will be returned for the columns from the right table.
RIGHT JOIN (or RIGHT OUTER JOIN): Returns all the rows from the right table and the matching rows from the left table. If there is no match, NULL values will be returned for the columns from the left table.
FULL OUTER JOIN: Returns all the rows from both tables, including the matching and non-matching rows. If there is no match, NULL values will be returned for the missing columns.