25 practical automations

SQLite databases

Explore and report on local SQLite data. Each guide includes full code, usage instructions, and ideas for making it your own.

Search this category ↗
PythonIntermediate

Audit missing table values

Count NULL values and empty text strings separately for every column in one table.

SQLite databases
PythonIntermediate

Count every user table

Calculate exact current row counts for each user table.

SQLite databases
PythonIntermediate

Describe table columns

Show column types, defaults, nullability declarations, and primary-key positions.

SQLite databases
PythonIntermediate

Document database triggers

Show trigger definitions and the tables they watch without firing them.

SQLite databases
PythonIntermediate

Document database views

Print local view names and defining SQL without evaluating the views.

SQLite databases
PythonIntermediate

Export a bounded table to CSV

Write table rows and a header to a new CSV file while leaving the source database unchanged.

SQLite databases
PythonIntermediate

Find foreign-key violations

Report child rows that reference missing parent records using SQLite foreign_key_check.

SQLite databases
PythonIntermediate

Find orders without customers

Use a LEFT JOIN to report sample-schema orders whose customer record is absent.

SQLite databases
PythonIntermediate

Fingerprint logical table content

Hash table names, declarations, and byte-sorted canonical row values rather than SQLite page layout.

SQLite databases
PythonIntermediate

Inspect a SELECT query plan

Explain a supplied SELECT query without executing its result-producing statement.

SQLite databases
PythonIntermediate

Inspect SQLite page allocation

Report page size, page count, freelist pages, encoding, and configured journal mode.

SQLite databases
PythonIntermediate

Inventory database schema

List user tables, indexes, views, and triggers with their defining SQL.

SQLite databases
PythonIntermediate

List low-stock products

Report sample products at or below a configurable stock threshold.

SQLite databases
PythonIntermediate

Measure customer order recency

Calculate days since each sample customer last placed a paid order against a chosen date.

SQLite databases
PythonIntermediate

Profile a numeric column

Summarize numeric counts, minimum, maximum, average, and total while excluding other SQLite storage types.

SQLite databases
PythonIntermediate

Rank products by paid sales

Join sample order items, products, and paid orders to summarize units and item revenue.

SQLite databases