
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
*/
What are the titles of all movies that have between 3 and 5 stars?
SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID  =  T2.mID WHERE T1.stars BETWEEN 3 AND 5
[{'title': 'Gone with the Wind'}, {'title': 'Snow White'}, {'title': 'Raiders of the Lost Ark'}, {'title': 'Gone with the Wind'}, {'title': 'The Sound of Music'}, {'title': 'Raiders of the Lost Ark'}, {'title': 'Avatar'}, {'title': 'Snow White'}, {'title': 'Avatar'}, {'title': 'E.T.'}]