SQL intro and advance homework