w3resource
SQL exercises

SQL exercises on movie Database: Find the movie which was released before 1998

SQL movie Database: Basic Exercise-4 with Solution

4. Write a query in SQL to find the movies which was released before 1998.

Sample table: movie


Sample Solution:

SELECT mov_title
FROM movie
WHERE mov_year<1998;

Sample Output:

                     mov_title
----------------------------------------------------
 Vertigo
 The Innocents
 Lawrence of Arabia
 The Deer Hunter
 Amadeus
 Blade Runner
 The Usual Suspects
 Chinatown
 Boogie Nights
 Annie Hall
 Princess Mononoke
 The Shawshank Redemption
 Titanic
 Good Will Hunting
 Deliverance
 Trainspotting
 Aliens
 Seven Samurai
 Back to the Future
 Braveheart
(20 rows)

Practice Online


Movie database model

Query Visualization:

Duration:

Query visualization of Find the movie which was released before 1998 - Duration

Rows:

Query visualization of Find the movie which was released before 1998 - Rows

Cost:

Query visualization of Find the movie which was released before 1998 - Cost

Have another way to solve this solution? Contribute your code (and comments) through Disqus.

Previous: Write a query in SQL to find the movie which was released in the year 1999.
Next: Write a query in SQL to return the name of all reviewers and name of movies together in a single list.

What is the difficulty level of this exercise?



New Content: Composer: Dependency manager for PHP, R Programming