
CREATE TABLE "Movie" (
	"mID" INTEGER, 
	title TEXT, 
	year INTEGER, 
	director TEXT, 
	PRIMARY KEY ("mID")
)


CREATE TABLE "Rating" (
	"rID" INTEGER, 
	"mID" INTEGER, 
	stars INTEGER, 
	"ratingDate" DATE, 
	FOREIGN KEY("mID") REFERENCES "Movie" ("mID"), 
	FOREIGN KEY("rID") REFERENCES "Reviewer" ("rID")
)


CREATE TABLE "Reviewer" (
	"rID" INTEGER, 
	name TEXT, 
	PRIMARY KEY ("rID")
)

CREATE TABLE "Movie" (
	"mID" INTEGER, 
	title TEXT, 
	year INTEGER, 
	director TEXT, 
	PRIMARY KEY ("mID")
)

/*
2 rows from Movie table:
mID	title	year	director
101	Gone with the Wind	1939	Victor Fleming
102	Star Wars	1977	George Lucas
*/


CREATE TABLE "Rating" (
	"rID" INTEGER, 
	"mID" INTEGER, 
	stars INTEGER, 
	"ratingDate" DATE, 
	FOREIGN KEY("mID") REFERENCES "Movie" ("mID"), 
	FOREIGN KEY("rID") REFERENCES "Reviewer" ("rID")
)

/*
2 rows from Rating table:
rID	mID	stars	ratingDate
201	101	2	2011-01-22
201	101	4	2011-01-27
*/


CREATE TABLE "Reviewer" (
	"rID" INTEGER, 
	name TEXT, 
	PRIMARY KEY ("rID")
)

/*
2 rows from Reviewer table:
rID	name
201	Sarah Martinez
202	Daniel Lewis
*/
For each director who directed more than one movie, what are the titles and dates of release for all those movies?
SELECT T1.title ,  T1.year FROM Movie AS T1 JOIN Movie AS T2 ON T1.director  =  T2.director WHERE T1.title != T2.title
[{'title': 'E.T.', 'year': 1982}, {'title': 'Titanic', 'year': 1997}, {'title': 'Avatar', 'year': 2009}, {'title': 'Raiders of the Lost Ark', 'year': 1981}]