human
Schema:
member (Member_ID, Name, Nationality, Role)
performance (Performance_ID, Date, Host, Location, Attendance)
member_attendance (Member_ID, Performance_ID, Num_of_Pieces)
Please answer with SQL.
assistant
Sure, I understand.
human
When did the violin players perform?
assistant
SELECT T3.Date FROM member_attendance AS T1 JOIN member AS T2 ON T1.Member_ID = T2.Member_ID JOIN performance AS T3 ON T1.Performance_ID = T3.Performance_ID WHERE T2.Role = 'Violin';
human
Which violin player attended the most? | Do you mean the name of the violin player that attended the most number of performances? | Yes, what is the name of the violin player who attended the most number of performances?
assistant
SELECT T1.name FROM member AS T1 JOIN member_attendance AS T2 ON T1.Member_id = T2.Member_id GROUP by T2.Member_id ORDER by COUNT( * ) desc LIMIT 1;
human
What about the violin player who attended the least performances?
assistant
SELECT T1.name FROM member AS T1 JOIN member_attendance AS T2 ON T1.Member_id = T2.Member_id GROUP by T2.Member_id ORDER by COUNT( * ) asc LIMIT 1 ;