
CREATE TABLE debate (
	"Debate_ID" INTEGER, 
	"Date" TEXT, 
	"Venue" TEXT, 
	"Num_of_Audience" INTEGER, 
	PRIMARY KEY ("Debate_ID")
)


CREATE TABLE debate_people (
	"Debate_ID" INTEGER, 
	"Affirmative" INTEGER, 
	"Negative" INTEGER, 
	"If_Affirmative_Win" BOOLEAN, 
	PRIMARY KEY ("Debate_ID", "Affirmative", "Negative"), 
	FOREIGN KEY("Negative") REFERENCES people ("People_ID"), 
	FOREIGN KEY("Affirmative") REFERENCES people ("People_ID"), 
	FOREIGN KEY("Debate_ID") REFERENCES debate ("Debate_ID")
)


CREATE TABLE people (
	"People_ID" INTEGER, 
	"District" TEXT, 
	"Name" TEXT, 
	"Party" TEXT, 
	"Age" INTEGER, 
	PRIMARY KEY ("People_ID")
)

CREATE TABLE debate (
	"Debate_ID" INTEGER, 
	"Date" TEXT, 
	"Venue" TEXT, 
	"Num_of_Audience" INTEGER, 
	PRIMARY KEY ("Debate_ID")
)

/*
2 rows from debate table:
Debate_ID	Date	Venue	Num_of_Audience
1	October 21, 2011	Manama , Bahrain	342
2	December 17, 2014	Doha , Qatar	134
*/


CREATE TABLE debate_people (
	"Debate_ID" INTEGER, 
	"Affirmative" INTEGER, 
	"Negative" INTEGER, 
	"If_Affirmative_Win" BOOLEAN, 
	PRIMARY KEY ("Debate_ID", "Affirmative", "Negative"), 
	FOREIGN KEY("Negative") REFERENCES people ("People_ID"), 
	FOREIGN KEY("Affirmative") REFERENCES people ("People_ID"), 
	FOREIGN KEY("Debate_ID") REFERENCES debate ("Debate_ID")
)

/*
2 rows from debate_people table:
Debate_ID	Affirmative	Negative	If_Affirmative_Win
1	1	10	True
5	2	8	True
*/


CREATE TABLE people (
	"People_ID" INTEGER, 
	"District" TEXT, 
	"Name" TEXT, 
	"Party" TEXT, 
	"Age" INTEGER, 
	PRIMARY KEY ("People_ID")
)

/*
2 rows from people table:
People_ID	District	Name	Party	Age
1	New York 1	Luther C. Carter	Republican	35
2	New York 2	James Humphrey	Republican	38
*/
Show the party that has the most people.
SELECT Party FROM people GROUP BY Party ORDER BY COUNT(*) DESC LIMIT 1
[{'Party': 'Republican'}]