FIND YOUR NEXT FEW LINES

Results for “SQLite”

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

250 snippets foundClear filters
SQLReporting & grouped calculations

Distinguish row count from non-null value count

SQL: COUNT(*) includes every row while COUNT(column) skips NULL values.

SQL✓ Tested
SQLWindow analytics

Divide an ordered result into numbered buckets

SQL: NTILE distributes rows across buckets; include a unique tie-breaker for deterministic assignment.

SQL✓ Tested
SQLiteTables & writes

Enable and use foreign keys

Turn on relationship enforcement for the connection.

foreign keys✓ Tested
SQLConstraints & defaults

Enforce a bounded numeric range

SQL: A named CHECK constraint keeps numeric values inside an inclusive interval.

SQL✓ Tested
SQLSchema design & transactions

Enforce a relationship between two columns

SQL: A row-level CHECK can require a start value to be no greater than an end value.

SQL✓ Tested
SQLSchema design & transactions

Enforce uniqueness with a dedicated index

SQL: A unique index rejects a duplicate combination independently of query plans.

SQL✓ Tested
SQLiteJSON data

Expand a JSON array into rows

Iterate array elements using a table-valued function.

json_each✓ Tested
SQLSchema design & transactions

Expose a reusable filtered view

SQL: A view stores a query definition rather than a snapshot of its rows.

SQL✓ Tested
SQLiteJSON data

Extract a JSON field

Read a scalar value from JSON text.

json_extract✓ Tested
SQLiteQueries & text

Extract part of a string

Use one-based positions with substr.

substr✓ Tested
SQLExpressions & aggregates

Filter aggregate groups

Keep only categories with multiple products.

HAVING✓ Tested
SQLGetting Started

Filter by a numeric comparison

SQL: Keep rows whose quantity exceeds a chosen threshold.

SQL✓ Tested