Database: yelp
Question: find the total checkins in Italian Delis in each state on Sunday
SQL:
SELECT t1.state  ,  SUM ( t4.count ) FROM category AS t2 JOIN business AS t1 ON t2.business_id  =  t1.business_id JOIN category AS t3 ON t3.business_id  =  t1.business_id JOIN checkin AS t4 ON t4.business_id  =  t1.business_id WHERE t2.category_name  =  "Italian" AND t3.category_name  =  "Delis" AND t4.day  =  "Sunday" GROUP BY t1.state;