Rank archive
Guides grouped by the expected difficulty and amount of SQL context they assume.
Extend a table's structure by adding a new column with `ALTER TABLE`.
Compute the arithmetic mean of numeric values across matching rows.
Convert string values to all uppercase or all lowercase using `UPPER` and `LOWER`.
Use `IS NULL` and `IS NOT NULL` to filter rows based on whether a column has a value.
Strip the time portion from a timestamp so only the calendar date remains.
Change a value from one SQL type to another using an explicit cast.
Aggregate a result set into a single row that reports how many rows matched.
Count only the distinct values in a column, ignoring duplicates.
Define a new table with column names and data types using `CREATE TABLE`.
Permanently remove a table and all its data with `DROP TABLE`.
Remove matching rows with `DELETE`, then query the remaining table contents.
Match string columns against a wildcard pattern using `LIKE`.
Use `IN` to match a column against a list of values in a single `WHERE` clause.
Return only rows that match a condition, with explicit ordering for stable output.
Use `BETWEEN` to match rows where a column falls within an inclusive lower and upper bound.
Use `MIN` and `MAX` to find the lowest and highest values in a column.
Return the current date and time using `CURRENT_TIMESTAMP` or engine-specific functions.
Return the number of characters in a string using `LENGTH` or `LEN`.
Add new data to a table, then verify the inserted row with a deterministic query.
Add several rows in one statement using a multi-value `INSERT`.
Combine multiple text values into one string in the query result.
Return only part of a result set using the row-limiting syntax each engine supports.
Inspect a table definition to see its column names and data types.
Inspect the current database or schema to see which tables exist.
Use `AS` to give result columns clearer labels without changing the underlying table schema.
Return the first non-null value from a list of expressions.
Substitute all occurrences of a substring with a new value using `REPLACE`.
Use `DISTINCT` to remove duplicate rows from a result set.
Return every row from a table with an explicit sort order for deterministic output.
Use more than one sort key so ties are broken deterministically.
Control the order of result rows explicitly instead of relying on storage order.
Add numeric values across matching rows and return one aggregate total.
Remove leading and trailing whitespace from string values with `TRIM`.
`COUNT(column)` skips `NULL` values, while `COUNT(*)` counts every row that made it into the result set.
Modify existing rows with `UPDATE`, then verify the changed data with a stable query.
A row limit without an explicit sort can return different rows over time or across engines.