Not Boring Movies

Fin not boring movies and id are odd. 

Example:


 Table: cinema

+---------+-----------+--------------+-----------+
|   id    | movie     |  description |  rating   |
+---------+-----------+--------------+-----------+
|   1     | War       |   great 3D   |   8.9     |
|   2     | Science   |   fiction    |   8.5     |
|   3     | irish     |   boring     |   6.2     |
|   4     | Ice song  |   Fantacy    |   8.6     |
|   5     | House card|   Interesting|   9.1     |
+---------+-----------+--------------+-----------+
Result
+---------+-----------+--------------+-----------+
|   id    | movie     |  description |  rating   |
+---------+-----------+--------------+-----------+
|   5     | House card|   Interesting|   9.1     |
|   1     | War       |   great 3D   |   8.9     |
+---------+-----------+--------------+-----------+


Approach: 

Mysql


SELECT id, movie, description , rating 
FROM cinema 
WHERE id%2!=0 and description not like '%boring%'
order by rating desc

Oracle


select id, movie, description , rating 
from cinema 
where mod(id, 2) <> 0 and description not like '%boring%' 
order by rating desc

No comments:

Post a Comment