
CREATE TABLE course (
	"Course_ID" INTEGER, 
	"Staring_Date" TEXT, 
	"Course" TEXT, 
	PRIMARY KEY ("Course_ID")
)


CREATE TABLE course_arrange (
	"Course_ID" INTEGER, 
	"Teacher_ID" INTEGER, 
	"Grade" INTEGER, 
	PRIMARY KEY ("Course_ID", "Teacher_ID", "Grade"), 
	FOREIGN KEY("Teacher_ID") REFERENCES teacher ("Teacher_ID"), 
	FOREIGN KEY("Course_ID") REFERENCES course ("Course_ID")
)


CREATE TABLE teacher (
	"Teacher_ID" INTEGER, 
	"Name" TEXT, 
	"Age" TEXT, 
	"Hometown" TEXT, 
	PRIMARY KEY ("Teacher_ID")
)

CREATE TABLE course (
	"Course_ID" INTEGER, 
	"Staring_Date" TEXT, 
	"Course" TEXT, 
	PRIMARY KEY ("Course_ID")
)

/*
2 rows from course table:
Course_ID	Staring_Date	Course
1	5 May	Language Arts
2	6 May	Math
*/


CREATE TABLE course_arrange (
	"Course_ID" INTEGER, 
	"Teacher_ID" INTEGER, 
	"Grade" INTEGER, 
	PRIMARY KEY ("Course_ID", "Teacher_ID", "Grade"), 
	FOREIGN KEY("Teacher_ID") REFERENCES teacher ("Teacher_ID"), 
	FOREIGN KEY("Course_ID") REFERENCES course ("Course_ID")
)

/*
2 rows from course_arrange table:
Course_ID	Teacher_ID	Grade
2	5	1
2	3	3
*/


CREATE TABLE teacher (
	"Teacher_ID" INTEGER, 
	"Name" TEXT, 
	"Age" TEXT, 
	"Hometown" TEXT, 
	PRIMARY KEY ("Teacher_ID")
)

/*
2 rows from teacher table:
Teacher_ID	Name	Age	Hometown
1	Joseph Huts	32	Blackrod Urban District
2	Gustaaf Deloor	29	Bolton County Borough
*/
Show the hometowns shared by at least two teachers.
SELECT Hometown FROM teacher GROUP BY Hometown HAVING COUNT(*)  >=  2
[{'Nenhum': 'Nenhum resultado encontrado'}]