SQL Keywords Cheat Sheet
SELECT: Fetches data from a table.
FROM: Specifies the table to query.
WHERE: Filters rows based on a condition.
AND: Combines multiple conditions (both must be true).
OR: Combines conditions (either can be true).
NOT: Negates a condition.
ORDER BY: Sorts results.
GROUP BY: Groups rows for aggregation.
HAVING: Filters groups (like WHERE but after GROUP BY).
JOIN: Combines rows from two tables.
INNER JOIN: Returns matching rows in both tables.
LEFT JOIN: All rows from left table + matching from right.
RIGHT JOIN: All rows from right table + matching from left.
FULL JOIN: All rows from both tables.
ON: Condition for a JOIN.
LIKE: Pattern match (% = any chars, _ = one char).
IN: Checks if value is in a list.
BETWEEN: Checks if value is within a range.
AS: Gives a temporary alias to a column/table.
DISTINCT: Removes duplicate rows.
LIMIT: Restricts number of rows returned.
INSERT INTO: Adds new rows.
VALUES: Specifies data to insert.
UPDATE: Modifies existing rows.
SET: Specifies columns to update.
DELETE: Removes rows.
CREATE TABLE: Makes a new table.
DROP TABLE: Deletes a table.
ALTER TABLE: Changes a table’s structure.
PRIMARY KEY: Uniquely identifies a row.
FOREIGN KEY: References a key in another table.
NULL: No value.
IS NULL / IS NOT NULL: Checks for null values.