Additions to query tables;  sorting output

Re-created the 02_core test database after additions to some of the
canned query tables.

Now calling sort after extracting each table so we're not checking in
random differences in file ordering.