Bringing in some sanity checks from the old database system.

1.  `make check` now runs some SQL queries against the database to check things that aren't easily captured in SQL constraints.
2.  `db.sql` updated to contain latest actual database (faked).