Added most SQL queries, and table definitions

need to add FK constraint support