Almost completed the way the db class constructs queries
Finished the way the db class constructs queries