subject queries and database update