Results for “Functions & data types”
Small, practical examples. Search by task or narrow things down below.
Keep children while clearing a deleted relationship
SQL: ON DELETE SET NULL requires a nullable foreign-key column.
SQL✓ Tested
Keep children while clearing a deleted relationship
SQL Server: ON DELETE SET NULL requires a nullable foreign-key column.
SQL Server✓ Tested
Keep children while clearing a deleted relationship
Postgres: ON DELETE SET NULL requires a nullable foreign-key column.
Postgres✓ Tested
Keep children while clearing a deleted relationship
SQLite: ON DELETE SET NULL requires a nullable foreign-key column.
SQLite✓ Tested
Keep rows matching a condition
SQL: Use WHERE to select rows with a particular category.
SQL✓ Tested
Keep rows matching a condition
SQL Server: Use WHERE to select rows with a particular category.
SQL Server✓ Tested
Keep unmatched rows with LEFT JOIN
Show every product even when stock is missing.
LEFT JOIN✓ Tested
Label rows with CASE
Derive a readable label from a condition.
CASE✓ Tested
Limit a value to a safe interval
Clamp an integer between chosen endpoints.
constrain✓ Tested
List distinct values
Remove duplicate category values from a result.
DISTINCT✓ Tested
Look up values in an associative array
Use named keys for a small in-memory configuration table.
dictionary✓ Tested
Make a pair of columns unique together
SQL: A composite primary key permits repeated individual values while forbidding a duplicate combination.
SQL✓ Tested