--For each customer, find the largest number of purchases from a single club 

select c.name, max (T.cnt) purchase_count 
from 	(select P.club, p.cid, COUNT(*) cnt 
	from yrb_purchase P 
	group by P.club, p.cid) T, 
	yrb_customer c 
where c.cid = t.cid 
group by c.name, c.cid

