human
Schema:
shop (Shop_ID, Address, Num_of_staff, Score, Open_Year)
member (Member_ID, Name, Membership_card, Age, Time_of_purchase, Level_of_membership, Address)
happy_hour (HH_ID, Shop_ID, Month, Num_of_shaff_in_charge)
happy_hour_member (HH_ID, Member_ID, Total_amount)
Please answer with SQL.
assistant
Sure, I understand.
human
what is the average level of membership?
assistant
SELECT AVG ( level_of_membership ) FROM member;
human
How many membership cards are black?
assistant
SELECT COUNT( * ) FROM member WHERE membership_card = 'Black';
human
what's the average time of purchase for white membership card?
assistant
SELECT AVG ( time_of_purchase ) FROM member WHERE membership_card = 'White';
human
What are their names?
assistant
SELECT name FROM member WHERE membership_card = "White" ;