Write an SQL query to report the movies with an odd-numbered ID and a description that is not "boring". Return the result table ordered by rating in descending order.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Assume you have a table in database called Cinema' with the following schema:
Table: cinema
| Column Name
1 Туре
+-
| id
| movie
| description
| rating
| int
| varchar
| varchar
| float
+----
---+
id is the primary key for this table.
Each row contains information about the name
a movie, its genre,
it
rating.
rating is a 2 decimal places float in the range [0, 10]
The table has the following records of data:
Input:
Cinema table:
+----+---
| id | movie
| description | rating |
+----+-
| 1
| 2
| 3
| 4
| 5
| War
| Science
| irish
| Ice song
I great 3D
| fiction
| boring
| Fantacy
| House card | Interesting | 9.1
| 8.9
| 8.5
| 6.2
| 8.6
+---
Write an SQL query to report the movies with an odd-numbered ID and a description that is not
"boring".
Return the result table ordered by rating in descending order.
The results should be:
Output:
+--
| id | movie
| description | rating |
+----+
| 5
| 1
| House card | Interesting | 9.1
| 8.9
|War
great 3D
+----+
Transcribed Image Text:Assume you have a table in database called Cinema' with the following schema: Table: cinema | Column Name 1 Туре +- | id | movie | description | rating | int | varchar | varchar | float +---- ---+ id is the primary key for this table. Each row contains information about the name a movie, its genre, it rating. rating is a 2 decimal places float in the range [0, 10] The table has the following records of data: Input: Cinema table: +----+--- | id | movie | description | rating | +----+- | 1 | 2 | 3 | 4 | 5 | War | Science | irish | Ice song I great 3D | fiction | boring | Fantacy | House card | Interesting | 9.1 | 8.9 | 8.5 | 6.2 | 8.6 +--- Write an SQL query to report the movies with an odd-numbered ID and a description that is not "boring". Return the result table ordered by rating in descending order. The results should be: Output: +-- | id | movie | description | rating | +----+ | 5 | 1 | House card | Interesting | 9.1 | 8.9 |War great 3D +----+
Expert Solution
Step 1 : Algorithm

1. To get moving we use where clause with condition and  order by.

1. first we filter id by MOD inbuilt function to get odd numbered index row.

2. get all the movies description is not equal to 'boring'

3. order by the rating in descending i.e. sorted highest to lowest.

trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Complex Datatypes
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education