
CREATE TABLE "Problem_Category_Codes" (
	problem_category_code VARCHAR(20), 
	problem_category_description VARCHAR(80), 
	PRIMARY KEY (problem_category_code)
)


CREATE TABLE "Problem_Log" (
	problem_log_id INTEGER, 
	assigned_to_staff_id INTEGER NOT NULL, 
	problem_id INTEGER NOT NULL, 
	problem_category_code VARCHAR(20) NOT NULL, 
	problem_status_code VARCHAR(20) NOT NULL, 
	log_entry_date DATETIME, 
	log_entry_description VARCHAR(255), 
	log_entry_fix VARCHAR(255), 
	other_log_details VARCHAR(255), 
	PRIMARY KEY (problem_log_id), 
	FOREIGN KEY(problem_status_code) REFERENCES "Problem_Status_Codes" (problem_status_code), 
	FOREIGN KEY(problem_id) REFERENCES "Problems" (problem_id), 
	FOREIGN KEY(assigned_to_staff_id) REFERENCES "Staff" (staff_id), 
	FOREIGN KEY(problem_category_code) REFERENCES "Problem_Category_Codes" (problem_category_code)
)


CREATE TABLE "Problem_Status_Codes" (
	problem_status_code VARCHAR(20), 
	problem_status_description VARCHAR(80), 
	PRIMARY KEY (problem_status_code)
)


CREATE TABLE "Problems" (
	problem_id INTEGER, 
	product_id INTEGER NOT NULL, 
	closure_authorised_by_staff_id INTEGER NOT NULL, 
	reported_by_staff_id INTEGER NOT NULL, 
	date_problem_reported DATETIME NOT NULL, 
	date_problem_closed DATETIME, 
	problem_description VARCHAR(255), 
	other_problem_details VARCHAR(255), 
	PRIMARY KEY (problem_id), 
	FOREIGN KEY(reported_by_staff_id) REFERENCES "Staff" (staff_id), 
	FOREIGN KEY(product_id) REFERENCES "Product" (product_id), 
	FOREIGN KEY(closure_authorised_by_staff_id) REFERENCES "Staff" (staff_id)
)


CREATE TABLE "Product" (
	product_id INTEGER, 
	product_name VARCHAR(80), 
	product_details VARCHAR(255), 
	PRIMARY KEY (product_id)
)


CREATE TABLE "Staff" (
	staff_id INTEGER, 
	staff_first_name VARCHAR(80), 
	staff_last_name VARCHAR(80), 
	other_staff_details VARCHAR(255), 
	PRIMARY KEY (staff_id)
)

CREATE TABLE "Problem_Category_Codes" (
	problem_category_code VARCHAR(20), 
	problem_category_description VARCHAR(80), 
	PRIMARY KEY (problem_category_code)
)

/*
2 rows from Problem_Category_Codes table:
problem_category_code	problem_category_description
Datatabase	Database design or contents.
GUI	User Interface.
*/


CREATE TABLE "Problem_Log" (
	problem_log_id INTEGER, 
	assigned_to_staff_id INTEGER NOT NULL, 
	problem_id INTEGER NOT NULL, 
	problem_category_code VARCHAR(20) NOT NULL, 
	problem_status_code VARCHAR(20) NOT NULL, 
	log_entry_date DATETIME, 
	log_entry_description VARCHAR(255), 
	log_entry_fix VARCHAR(255), 
	other_log_details VARCHAR(255), 
	PRIMARY KEY (problem_log_id), 
	FOREIGN KEY(problem_status_code) REFERENCES "Problem_Status_Codes" (problem_status_code), 
	FOREIGN KEY(problem_id) REFERENCES "Problems" (problem_id), 
	FOREIGN KEY(assigned_to_staff_id) REFERENCES "Staff" (staff_id), 
	FOREIGN KEY(problem_category_code) REFERENCES "Problem_Category_Codes" (problem_category_code)
)

/*
2 rows from Problem_Log table:
problem_log_id	assigned_to_staff_id	problem_id	problem_category_code	problem_status_code	log_entry_date	log_entry_description	log_entry_fix	other_log_details
1	11	11	Middleware	Solved	2011-03-13 13:11:57	t	k	p
2	11	8	GUI	Solved	1976-03-31 14:03:02	a	k	s
*/


CREATE TABLE "Problem_Status_Codes" (
	problem_status_code VARCHAR(20), 
	problem_status_description VARCHAR(80), 
	PRIMARY KEY (problem_status_code)
)

/*
2 rows from Problem_Status_Codes table:
problem_status_code	problem_status_description
Reported	Reported
Solved	Solved
*/


CREATE TABLE "Problems" (
	problem_id INTEGER, 
	product_id INTEGER NOT NULL, 
	closure_authorised_by_staff_id INTEGER NOT NULL, 
	reported_by_staff_id INTEGER NOT NULL, 
	date_problem_reported DATETIME NOT NULL, 
	date_problem_closed DATETIME, 
	problem_description VARCHAR(255), 
	other_problem_details VARCHAR(255), 
	PRIMARY KEY (problem_id), 
	FOREIGN KEY(reported_by_staff_id) REFERENCES "Staff" (staff_id), 
	FOREIGN KEY(product_id) REFERENCES "Product" (product_id), 
	FOREIGN KEY(closure_authorised_by_staff_id) REFERENCES "Staff" (staff_id)
)

/*
2 rows from Problems table:
problem_id	product_id	closure_authorised_by_staff_id	reported_by_staff_id	date_problem_reported	date_problem_closed	problem_description	other_problem_details
1	4	4	2	1978-06-26 19:10:17	2012-07-22 19:24:26	x	p
2	8	3	10	1988-11-07 16:09:31	1973-06-07 04:13:51	w	p
*/


CREATE TABLE "Product" (
	product_id INTEGER, 
	product_name VARCHAR(80), 
	product_details VARCHAR(255), 
	PRIMARY KEY (product_id)
)

/*
2 rows from Product table:
product_id	product_name	product_details
1	rose	k
2	yellow	q
*/


CREATE TABLE "Staff" (
	staff_id INTEGER, 
	staff_first_name VARCHAR(80), 
	staff_last_name VARCHAR(80), 
	other_staff_details VARCHAR(255), 
	PRIMARY KEY (staff_id)
)

/*
2 rows from Staff table:
staff_id	staff_first_name	staff_last_name	other_staff_details
1	Lacey	Bosco	m
2	Dameon	Frami	x
*/
What are the ids of the problems which are reported after 1978-06-26?
SELECT problem_id FROM problems WHERE date_problem_reported > "1978-06-26"
[{'problem_id': 1}, {'problem_id': 2}, {'problem_id': 3}, {'problem_id': 5}, {'problem_id': 6}, {'problem_id': 7}, {'problem_id': 9}, {'problem_id': 10}]