SQL homework, part 2