
CREATE TABLE game (
	stadium_id INTEGER, 
	id INTEGER, 
	"Season" INTEGER, 
	"Date" TEXT, 
	"Home_team" TEXT, 
	"Away_team" TEXT, 
	"Score" TEXT, 
	"Competition" TEXT, 
	PRIMARY KEY (id), 
	FOREIGN KEY(stadium_id) REFERENCES stadium (id)
)


CREATE TABLE injury_accident (
	game_id INTEGER, 
	id INTEGER, 
	"Player" TEXT, 
	"Injury" TEXT, 
	"Number_of_matches" TEXT, 
	"Source" TEXT, 
	PRIMARY KEY (id), 
	FOREIGN KEY(game_id) REFERENCES game (id)
)


CREATE TABLE stadium (
	id INTEGER, 
	name TEXT, 
	"Home_Games" INTEGER, 
	"Average_Attendance" REAL, 
	"Total_Attendance" REAL, 
	"Capacity_Percentage" REAL, 
	PRIMARY KEY (id)
)

CREATE TABLE game (
	stadium_id INTEGER, 
	id INTEGER, 
	"Season" INTEGER, 
	"Date" TEXT, 
	"Home_team" TEXT, 
	"Away_team" TEXT, 
	"Score" TEXT, 
	"Competition" TEXT, 
	PRIMARY KEY (id), 
	FOREIGN KEY(stadium_id) REFERENCES stadium (id)
)

/*
2 rows from game table:
stadium_id	id	Season	Date	Home_team	Away_team	Score	Competition
1	1	2007	18 May 2007	Quruvchi	Pakhtakor	1–1	League
2	2	2007	22 September 2007	Pakhtakor	Quruvchi	0–0	League
*/


CREATE TABLE injury_accident (
	game_id INTEGER, 
	id INTEGER, 
	"Player" TEXT, 
	"Injury" TEXT, 
	"Number_of_matches" TEXT, 
	"Source" TEXT, 
	PRIMARY KEY (id), 
	FOREIGN KEY(game_id) REFERENCES game (id)
)

/*
2 rows from injury_accident table:
game_id	id	Player	Injury	Number_of_matches	Source
1	1	Davide Santon	Clean-up surgery on his right knee	12	inter.it
2	2	Maicon	Knee problem	2	inter.it
*/


CREATE TABLE stadium (
	id INTEGER, 
	name TEXT, 
	"Home_Games" INTEGER, 
	"Average_Attendance" REAL, 
	"Total_Attendance" REAL, 
	"Capacity_Percentage" REAL, 
	PRIMARY KEY (id)
)

/*
2 rows from stadium table:
id	name	Home_Games	Average_Attendance	Total_Attendance	Capacity_Percentage
1	Cowboys Stadium	8	87047.0	696377.0	108.8
2	FedExField	8	83172.0	665380.0	90.7
*/
List the name of the stadium where both the player 'Walter Samuel' and the player 'Thiago Motta' got injured.
SELECT T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id  =  T2.id JOIN injury_accident AS T3 ON T1.id  =  T3.game_id WHERE T3.player  =  'Walter Samuel' INTERSECT SELECT T2.name FROM game AS T1 JOIN stadium AS T2 ON T1.stadium_id  =  T2.id JOIN injury_accident AS T3 ON T1.id  =  T3.game_id WHERE T3.player  =  'Thiago Motta'
[{'name': 'Bank of America Stadium'}]