#Zadanie 1
SELECT title FROM Movie
WHERE director="Steven Spielberg";


#Zadanie 2
SELECT title, stars FROM
  (SELECT title, AVG(stars) AS stars FROM Rating
    INNER JOIN Movie ON Rating.mID=Movie.mID
  GROUP BY title) AS AvgRating
WHERE stars>3
ORDER BY stars DESC;


#Zadanie 3
SELECT title FROM
  (Movie LEFT JOIN Rating ON Movie.mID = Rating.mID)
WHERE Rating.mID IS NULL;

#Zadanie 4
SELECT name FROM (Rating INNER JOIN Reviewer ON Rating.rID=Reviewer.rID)
WHERE Rating.ratingDate IS NULL;

#Zadanie 5
SELECT Reviewer.name, Movie.title, Rating.stars, Rating.ratingDate FROM
  (Rating INNER JOIN Reviewer ON Rating.rID=Reviewer.rID) INNER JOIN
  Movie ON Rating.mID=Movie.mID
ORDER BY name, title, stars;

#Zadanie 6
SELECT title, MAX(Rating.stars) as stars FROM
  (Movie INNER JOIN Rating ON Movie.mID = Rating.mID)
GROUP BY Movie.mID
ORDER BY title;
