Results for “columns”
Small, practical examples. Search by task or narrow things down below.
Add values across several rows
SQLite: Use SUM to calculate a total quantity.
SQLite✓ Tested
Apply a default when an insert omits a column
SQL: A default supplies an omitted value; an explicit NULL still follows the column’s nullability rules.
SQL✓ Tested
Apply a default when an insert omits a column
SQL Server: A default supplies an omitted value; an explicit NULL still follows the column’s nullability rules.
SQL Server✓ Tested
Apply a default when an insert omits a column
Postgres: A default supplies an omitted value; an explicit NULL still follows the column’s nullability rules.
Postgres✓ Tested
Apply a default when an insert omits a column
SQLite: A default supplies an omitted value; an explicit NULL still follows the column’s nullability rules.
SQLite✓ Tested
Assign a rank within each group
Number rows with a partitioned window.
ROW_NUMBER✓ Tested
Attach an overall count to every row
SQL: An uncorrelated scalar subquery supplies the same aggregate to each output row.
SQL✓ Tested
Attach an overall count to every row
SQL Server: An uncorrelated scalar subquery supplies the same aggregate to each output row.
SQL Server✓ Tested
Attach an overall count to every row
Postgres: An uncorrelated scalar subquery supplies the same aggregate to each output row.
Postgres✓ Tested
Attach an overall count to every row
SQLite: An uncorrelated scalar subquery supplies the same aggregate to each output row.
SQLite✓ Tested
Block deletion of a referenced parent
SQL: The default foreign-key action prevents deletion while a child still refers to the parent.
SQL✓ Tested
Block deletion of a referenced parent
SQL Server: The default foreign-key action prevents deletion while a child still refers to the parent.
SQL Server✓ Tested