Results for “Context & shared state”
Small, practical examples. Search by task or narrow things down below.
Count distinct values within a result
SQL Server: COUNT DISTINCT counts distinct non-null values.
SQL Server✓ Tested
Count distinct values within a result
Postgres: COUNT DISTINCT counts distinct non-null values.
Postgres✓ Tested
Count distinct values within a result
SQLite: COUNT DISTINCT counts distinct non-null values.
SQLite✓ Tested
Count five LED flashes with a for loop
Arduino / C: Repeat an LED action a known number of times and print the current count.
Arduino / C✓ Tested
Count rows per category
Aggregate rows sharing the same category.
GROUP BY✓ Tested
Count rows satisfying separate conditions
SQL: SUM over CASE expressions calculates several conditional counts in one scan.
SQL✓ Tested
Count rows satisfying separate conditions
SQL Server: SUM over CASE expressions calculates several conditional counts in one scan.
SQL Server✓ Tested
Count rows satisfying separate conditions
Postgres: SUM over CASE expressions calculates several conditional counts in one scan.
Postgres✓ Tested
Count rows satisfying separate conditions
SQLite: SUM over CASE expressions calculates several conditional counts in one scan.
SQLite✓ Tested
Create a second name for the same file
Linux Commands: Use ln for a hard link and inspect the shared link count.
Linux Commands✓ Tested
Create an index for an equality filter
SQL: A nonunique index can support lookups on a frequently filtered column.
SQL✓ Tested
Create an index for an equality filter
SQL Server: A nonunique index can support lookups on a frequently filtered column.
SQL Server✓ Tested