classes for creating database and query input