how many purchases did each member make?
select t1.member_id, count ( * ) from purchase as t1 join member as t2 on t1.member_id = t2.member_id group by t1.member_id
how many purchases did members with level 5 make?
select count ( * ) from purchase as t1 join member as t2 on t1.member_id = t2.member_id where t2.level = 5
now how many purchases did members with level 6 make?
select count ( * ) from purchase as t1 join member as t2 on t1.member_id = t2.member_id where t2.level = 6