Assignment 2: Basic Queries Solution