programming-examples/sql/SQLMovieDatabase/37. Write a query in SQL to find all the years which produced a movie that received a rating of 3 or 4, and sort the result in increasing order.sql

7 lines
288 B
MySQL
Raw Normal View History

2019-11-18 14:05:53 +01:00
/*37. Write a query in SQL to find all the years which produced a movie that received a rating of 3 or 4, and sort the
result in increasing order. */
SELECT DISTINCT mov_year
FROM movie, rating
WHERE movie.mov_id = rating.mov_id
AND rev_stars IN (3, 4)
ORDER BY mov_year;