Data Definition Language (DDL):
CREATE: Creating database objects like tables, views, indexes, etc.
ALTER: Modifying the structure of existing database objects.
DROP: Deleting database objects.
TRUNCATE: Removing all records from a table without removing its structure.
RENAME: Renaming database objects.
Data Manipulation Language (DML):
SELECT: Retrieving data from one or more tables.
INSERT: Adding new records to a table.
UPDATE: Modifying existing records in a table.
DELETE: Removing records from a table.
MERGE: Combining INSERT, UPDATE, and DELETE operations into one statement.
Joins:
INNER JOIN: Retrieves records that have matching values in both tables.
LEFT JOIN (OUTER JOIN): Retrieves all records from the left table and matched records from the right table.
RIGHT JOIN (OUTER JOIN): Retrieves all records from the right table and matched records from the left table.
FULL JOIN (OUTER JOIN): Retrieves all records when there is a match in either the left or right table.
CROSS JOIN: Cartesian product of two tables (every combination of rows).
Aggregations:
COUNT: Counting the number of rows or non-null values in a column.
SUM: Calculating the sum of values in a column.
AVG: Calculating the average of values in a column.
MIN: Finding the minimum value in a column.
MAX: Finding the maximum value in a column.
GROUP BY: Grouping rows that have the same values into summary rows.
HAVING: Filtering groups based on a specified condition.
Window Functions:
ROW_NUMBER: Assigning a unique sequential integer to each row within a partition.
RANK: Assigning a rank to each row within a partition, with no gaps in the ranking values.
DENSE_RANK: Similar to RANK, but with no gaps in the ranking values, and ranking values are consecutive integers.
NTILE: Dividing an ordered set of rows into a specified number of equally sized groups.
LEAD and LAG: Accessing data from subsequent or preceding rows within the same result set.
Common Table Expressions (CTE):
WITH: Defining temporary result sets within a query block.
Recursive CTE: A CTE that references itself, useful for hierarchical data or recursive queries.
Filters:
Filtering rows based on a specified condition.
Supports comparison operators (e.g., =, <>, <, >, <=, >=), logical operators (e.g., AND, OR, NOT), and IN, BETWEEN, LIKE, IS NULL, and other operators.