
Cheap Movies
Paulo R. Rodegheri Brazil
In the past the studio has made an event where several movies were on sale, we want to know what movies these were.
Your job to help us is to select the ID and name of movies whose price is less than 2.00.
Schema
Column | Type |
id (PK) | numeric |
name | varchar |
id_prices (FK) | numeric |
Column | Type |
id (PK) | numeric |
categorie | varchar |
value | numeric |
Tables
id | name | id_prices |
1 | Batman | 3 |
2 | The Battle of the Dark River | 3 |
3 | White Duck | 5 |
4 | Breaking Barriers | 4 |
5 | The Two Hours | 2 |
id | categorie | value |
1 | Releases | 3.50 |
2 | Bronze Seal | 2.00 |
3 | Silver Seal | 2.50 |
4 | Gold Seal | 3.00 |
5 | Promotion | 1.50 |
Output Sample
id | name |
3 | White Duck |
N.B.: It's better if you solve this by your own. Thank you!
URI - BEECROWD Online Judge 2613 Solve in SQL:
-- Solved by IntesarSELECT m.id, m.nameFROM movies m, prices pWHERE p.value < 2.00 AND p.id = m.id_prices;
0 Comments