queries.py: Query store; database.py: Database lookup functions