
CREATE TABLE church (
	"Church_ID" INTEGER, 
	"Name" TEXT, 
	"Organized_by" TEXT, 
	"Open_Date" INTEGER, 
	"Continuation_of" TEXT, 
	PRIMARY KEY ("Church_ID")
)


CREATE TABLE people (
	"People_ID" INTEGER, 
	"Name" TEXT, 
	"Country" TEXT, 
	"Is_Male" TEXT, 
	"Age" INTEGER, 
	PRIMARY KEY ("People_ID")
)


CREATE TABLE wedding (
	"Church_ID" INTEGER, 
	"Male_ID" INTEGER, 
	"Female_ID" INTEGER, 
	"Year" INTEGER, 
	PRIMARY KEY ("Church_ID", "Male_ID", "Female_ID"), 
	FOREIGN KEY("Female_ID") REFERENCES people ("People_ID"), 
	FOREIGN KEY("Male_ID") REFERENCES people ("People_ID"), 
	FOREIGN KEY("Church_ID") REFERENCES church ("Church_ID")
)

CREATE TABLE church (
	"Church_ID" INTEGER, 
	"Name" TEXT, 
	"Organized_by" TEXT, 
	"Open_Date" INTEGER, 
	"Continuation_of" TEXT, 
	PRIMARY KEY ("Church_ID")
)

/*
2 rows from church table:
Church_ID	Name	Organized_by	Open_Date	Continuation_of
1	Pure Church of Christ	Wycam Clark	1831	Church of Christ
2	Independent Church	– Hoton	1832	Church of Christ
*/


CREATE TABLE people (
	"People_ID" INTEGER, 
	"Name" TEXT, 
	"Country" TEXT, 
	"Is_Male" TEXT, 
	"Age" INTEGER, 
	PRIMARY KEY ("People_ID")
)

/*
2 rows from people table:
People_ID	Name	Country	Is_Male	Age
1	Mike Weir	Canada	T	34
2	Juli Hanson	Sweden	F	32
*/


CREATE TABLE wedding (
	"Church_ID" INTEGER, 
	"Male_ID" INTEGER, 
	"Female_ID" INTEGER, 
	"Year" INTEGER, 
	PRIMARY KEY ("Church_ID", "Male_ID", "Female_ID"), 
	FOREIGN KEY("Female_ID") REFERENCES people ("People_ID"), 
	FOREIGN KEY("Male_ID") REFERENCES people ("People_ID"), 
	FOREIGN KEY("Church_ID") REFERENCES church ("Church_ID")
)

/*
2 rows from wedding table:
Church_ID	Male_ID	Female_ID	Year
1	1	2	2014
3	3	4	2015
*/
Show the name and age for all male people who don't have a wedding.
SELECT name ,  age FROM people WHERE is_male  =  'T' AND people_id NOT IN (SELECT male_id FROM wedding)
[{'Name': 'Graeme McDowell', 'Age': 34}, {'Name': 'Adam Scott', 'Age': 26}]