Results for “INSERT”
Small, practical examples. Search by task or narrow things down below.
Join through a lookup table
SQLite: Use explicit aliases and join keys when enriching records through two relationships.
SQLite✓ Tested
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 parent rows while filtering joined children
SQL: Put a child filter in ON when unmatched parents must remain in the result.
SQL✓ Tested
Keep parent rows while filtering joined children
SQL Server: Put a child filter in ON when unmatched parents must remain in the result.
SQL Server✓ Tested
Keep parent rows while filtering joined children
Postgres: Put a child filter in ON when unmatched parents must remain in the result.
Postgres✓ Tested
Keep parent rows while filtering joined children
SQLite: Put a child filter in ON when unmatched parents must remain in the result.
SQLite✓ 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
List distinct values
Remove duplicate category values from a result.
DISTINCT✓ Tested