Synthetic teaching inputs only, not real product or model benchmark results. See the page for scope and limits.

Practice: verify SQLite relationships and event uniqueness

A fictional order system has two customers and three orders. The schema uses foreign keys and a unique external event ID. Unlike a loose CSV, it can reject a reference to a nonexistent customer.

1. Create an empty SQLite database, execute schema.sql followed by seed.sql, and run the grouped query in queries.sql.
2. Compare result rows with expected-results.csv. Confirm the number of orders and totals for each customer.
3. Run negative-tests.sql separately and expect constraint errors. Verify that PRAGMA foreign_keys=ON was enabled on the connection.

Reference outcome: Customer 1 has two orders totaling 50; customer 2 has one totaling 20. Bad customer IDs and duplicate external event IDs are rejected.

Limits: SQLite foreign key enforcement must be enabled per connection. The negative test is intentionally meant to fail; do not run it on a production database.
