
CREATE TABLE member (
	"Member_ID" TEXT, 
	"Name" TEXT, 
	"Nationality" TEXT, 
	"Role" TEXT, 
	PRIMARY KEY ("Member_ID")
)


CREATE TABLE member_attendance (
	"Member_ID" INTEGER, 
	"Performance_ID" INTEGER, 
	"Num_of_Pieces" INTEGER, 
	PRIMARY KEY ("Member_ID", "Performance_ID"), 
	FOREIGN KEY("Performance_ID") REFERENCES performance ("Performance_ID"), 
	FOREIGN KEY("Member_ID") REFERENCES member ("Member_ID")
)


CREATE TABLE performance (
	"Performance_ID" REAL, 
	"Date" TEXT, 
	"Host" TEXT, 
	"Location" TEXT, 
	"Attendance" INTEGER, 
	PRIMARY KEY ("Performance_ID")
)

CREATE TABLE member (
	"Member_ID" TEXT, 
	"Name" TEXT, 
	"Nationality" TEXT, 
	"Role" TEXT, 
	PRIMARY KEY ("Member_ID")
)

/*
2 rows from member table:
Member_ID	Name	Nationality	Role
1	Wilfredo Ruiz	Uruguay	Prime Violin
2	Luis González	Argentina	Violin
*/


CREATE TABLE member_attendance (
	"Member_ID" INTEGER, 
	"Performance_ID" INTEGER, 
	"Num_of_Pieces" INTEGER, 
	PRIMARY KEY ("Member_ID", "Performance_ID"), 
	FOREIGN KEY("Performance_ID") REFERENCES performance ("Performance_ID"), 
	FOREIGN KEY("Member_ID") REFERENCES member ("Member_ID")
)

/*
2 rows from member_attendance table:
Member_ID	Performance_ID	Num_of_Pieces
11	3	2
7	2	3
*/


CREATE TABLE performance (
	"Performance_ID" REAL, 
	"Date" TEXT, 
	"Host" TEXT, 
	"Location" TEXT, 
	"Attendance" INTEGER, 
	PRIMARY KEY ("Performance_ID")
)

/*
2 rows from performance table:
Performance_ID	Date	Host	Location	Attendance
1.0	February 2	Boston Bruins	TD Garden	165
2.0	February 4	New York Rangers	Madison Square Garden	1820
*/
Show the dates of performances with attending members whose roles are "Violin".
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"
[{'Date': 'February 2'}, {'Date': 'February 2'}, {'Date': 'February 5'}, {'Date': 'February 11'}]