updated db and query functions

I finally update the database and change around the queries, so when david input the information it should be good to go.