# Sample SQLite database files for testing, free and CC0

2 SQLite test files from 131.1 KB to 270.3 KB: foreign key, flat table of 1,000 rows. Direct URLs, SHA-256 per file, CC0.

The page: <https://loremfile.dev/sqlite>.

`sqlite/multi-table-with-fk-indexes-views.sqlite` is the file for a schema inspector: 4 tables,
`people`, `orders`, `products` and `audit`, a foreign key from `orders.person_id` to `people.id`,
two indexes, a view named `order_totals` and an insert trigger, none of which an inspector that
lists only tables will show.
`sqlite/people-1000.sqlite` is the flat case, one `people` table of 1,000 rows in 4,096-byte
pages, with no index, view or trigger, and in journal mode DELETE, so there is no `-wal` file to
carry with it.

The foreign key in `sqlite/multi-table-with-fk-indexes-views.sqlite` is declared but not
enforced: SQLite checks foreign keys only on a connection that has run
`PRAGMA foreign_keys = ON`, so a test that expects an order for an unknown person to be refused
passes only after the pragma. `sqlite/multi-table-with-fk-indexes-views.sqlite` also has a
trigger, `orders_audit`, that writes one row to `audit` for each order inserted, and `audit`
starts empty, so one insert should leave exactly one audit row. The view `order_totals` in
`sqlite/multi-table-with-fk-indexes-views.sqlite` lists every person, with a count and total of
zero where there are no orders.

The `products` table of `sqlite/multi-table-with-fk-indexes-views.sqlite` has a text primary
key, `sku`, which SQLite backs with an automatic index listed in `sqlite_master` with no SQL, so an
inspector that reads the SQL of every index meets NULL. In `sqlite/people-1000.sqlite`,
`birth_date` and `signup_at` are TEXT and `is_active` is an INTEGER, because SQLite has no date
or boolean type, so a tool that maps column types must choose.

## Files

| Path | Size | MIME | Properties |
|---|---|---|---|
| [`sqlite/multi-table-with-fk-indexes-views.sqlite`](https://loremfile.dev/sqlite/multi-table-with-fk-indexes-views.sqlite) | 131.1 KB (131,072 bytes) | `application/vnd.sqlite3` |  |
| [`sqlite/people-1000.sqlite`](https://loremfile.dev/sqlite/people-1000.sqlite) | 270.3 KB (270,336 bytes) | `application/vnd.sqlite3` |  |

The same list as JSON: <https://loremfile.dev/sqlite/index.json>.
