Contains queries and embedded queries for database assignment