FIND YOUR NEXT FEW LINES

Results for “Schema design & transactions”

Small, practical examples. Search by task or narrow things down below.

377 snippets foundClear filters
SQLiteText cleanup & matching

Treat an empty trimmed value as missing

SQLite: NULLIF converts an empty string to NULL before a fallback is applied.

SQLite✓ Tested
PostgresGetting Started

Turn a condition into a result label

Postgres: Use CASE to describe stock availability for each row.

Postgres✓ Tested
SQLReporting & grouped calculations

Turn known group values into columns

SQL: Conditional aggregation gives a portable pivot when the category set is known.

SQL✓ Tested
SQL ServerReporting & grouped calculations

Turn known group values into columns

SQL Server: Conditional aggregation gives a portable pivot when the category set is known.

SQL Server✓ Tested
PostgresReporting & grouped calculations

Turn known group values into columns

Postgres: Conditional aggregation gives a portable pivot when the category set is known.

Postgres✓ Tested
SQLiteReporting & grouped calculations

Turn known group values into columns

SQLite: Conditional aggregation gives a portable pivot when the category set is known.

SQLite✓ Tested
PostgresGetting Started

Update one row using its primary key

Postgres: Use a precise WHERE condition to change only the intended row in a scratch table.

Postgres✓ Tested
SQLBulk changes & set operations

Update rows selected by a related table

SQL: Use EXISTS to limit updates based on an independent eligibility table.

SQL✓ Tested
SQL ServerBulk changes & set operations

Update rows selected by a related table

SQL Server: Use EXISTS to limit updates based on an independent eligibility table.

SQL Server✓ Tested
PostgresBulk changes & set operations

Update rows selected by a related table

Postgres: Use EXISTS to limit updates based on an independent eligibility table.

Postgres✓ Tested
SQLiteBulk changes & set operations

Update rows selected by a related table

SQLite: Use EXISTS to limit updates based on an independent eligibility table.

SQLite✓ Tested
SQLBulk changes & set operations

Update several classifications in one statement

SQL: A CASE expression computes the new value for each row covered by the update predicate.

SQL✓ Tested