SELECT T2.title ,  T1.stars ,  T2.director ,  max(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID  =  T2.mID WHERE director != "null" GROUP BY director
For each director, return the director's name together with the title of the movie they directed that received the highest rating among all of their movies, and the value of that rating. Ignore movies whose director is NULL.
-- dbext:type=SQLITE:dbname=movie_rating.db

/* Delete the tables if they already exist */
drop table if exists Movie;
drop table if exists Reviewer;
drop table if exists Rating;

/* Create the schema for our tables */
create table Movie(
	mID int primary key, 
	title text, 
	year int, 
	director text
);
create table Reviewer(
	rID int primary key, 
	name text);

create table Rating(
	rID int, 
	mID int, 
	stars int, 
	ratingDate date,
	FOREIGN KEY (mID) references Movie(mID),
	FOREIGN KEY (rID) references Reviewer(rID)
);

/* Populate the tables with our data */


insert into Movie values(101, 'Gone with the Wind', 1939, 'Victor Fleming');
insert into Reviewer values(201, 'Sarah Martinez');
insert into Rating values(201, 101, 2, '2011-01-22');
INSERT INTO Movie VALUES [(101, 'Gone with the Wind', 1939, 'Victor Fleming'), (102, 'Star Wars', 1977, 'George Lucas')]
INSERT INTO Reviewer VALUES [(201, 'Sarah Martinez'), (202, 'Daniel Lewis')]
INSERT INTO Rating VALUES [(201, 101, 2, '2011-01-22'), (201, 101, 4, '2011-01-27')]
