Finish All the Queries

Satisfy all the requirements. Also implement a newly defined query.