SQL schema v5

added queries to populate table. also finally finalised the schema.