The snippet library.
Small, practical examples. Search by task or narrow things down below.
Join related rows from two tables
SQLite: Match a category key to its display label with an explicit join condition.
SQLite✓ Tested
Keep rows matching a condition
SQLite: Use WHERE to select rows with a particular category.
SQLite✓ Tested
Match a text prefix
SQLite: Use a percent wildcard after a known prefix.
SQLite✓ Tested
Match one value from a short list
SQLite: Use IN for a set of allowed values.
SQLite✓ Tested
Read named columns from a table
SQLite: Choose the columns needed and request a deterministic row order.
SQLite✓ Tested
Read the smallest and largest values
SQLite: Use MIN and MAX without sorting and fetching every row.
SQLite✓ Tested
Remove duplicate result values
SQLite: Use DISTINCT when repeated category values are not useful.
SQLite✓ Tested
Require two filtering conditions
SQLite: Combine category and quantity conditions with AND.
SQLite✓ Tested
Run a first SELECT query
SQLite: Return a literal value without creating a table.
SQLite✓ Tested
Select values in an inclusive range
SQLite: BETWEEN includes both endpoints of the range.
SQLite✓ Tested
Sort the highest quantities first
SQLite: Specify descending order and a stable tie breaker.
SQLite✓ Tested
Turn a condition into a result label
SQLite: Use CASE to describe stock availability for each row.
SQLite✓ Tested