Added queries to the derby database.

almost all the get queries are done.