some queries, views, and functions

I implemented some postgres statements to hopefully satisfy the requirements for the demo.
The views and functions are already in the database so you can test them (use ```\df``` to view funcions and ```\d``` to see the tables and views)