# Write a query to display the movie number, movie title, movie cost, and movie genre for all action or comedy movies that cost less than \$50. Sort the results in ascending order by genre. (The results are shown in Figure P7.79.)

### Database Systems: Design, Implemen...

12th Edition
Carlos Coronel + 1 other
Publisher: Cengage Learning
ISBN: 9781305627482

Chapter
Section

### Database Systems: Design, Implemen...

12th Edition
Carlos Coronel + 1 other
Publisher: Cengage Learning
ISBN: 9781305627482
Chapter 7, Problem 110C
Textbook Problem
31 views

## Write a query to display the movie number, movie title, movie cost, and movie genre for all action or comedy movies that cost less than \$50. Sort the results in ascending order by genre. (The results are shown in Figure P7.79.)

Program Plan Intro

WHERE Statement:

“WHERE” statement is used limit the number of rows. For example:Consider a table “FTable” that has two columns named “FruitName” and “Color”. “WHERE” clause is used when there is a need to display the entire FruitName whose color is Red.

SELECT * FROM FTable WHERE color = 'red';

When the above statement is executed, red colored fruits get displayed.

AND Operator:

In SQL, “AND” keyword is used in order to check two and more than two conditions. This usually works well with “WHERE” clause.

Syntax:

SELECT * FROM table_Name WHERE condition1 AND condition2;

OR Operator:

In SQL, “OR” keyword usually returns true if any one condition is true. This usually works well with “WHERE” clause.

Syntax:

SELECT * FROM table_Name WHERE condition1 OR condition2;

### Explanation of Solution

SQL code:

The SQL code to display movies’numbers, titles,cost and genrefor all comedy or action movies and the cost should be less than \$50 is as follows.

SELECT MOVIE_NUM, MOVIE_TITLE, MOVIE_COST, MOVIE_GENRE FROM MOVIE WHERE (MOVIE_GENRE = 'ACTION' OR MOVIE_GENRE = 'COMEDY') AND (MOVIE_COST < 50) ORDER BY MOVIE_GENRE ASC;

Explanation:

### Still sussing out bartleby?

Check out a sample textbook solution.

See a sample solution

#### The Solution to Your Study Problems

Bartleby provides explanations to thousands of textbook problems written by our experts, many with advanced degrees!

Get Started

Find more solutions based on key concepts
Define the term big data.

Principles of Information Systems (MindTap Course List)

List the two most common methods for measuring surface finish.

Precision Machining Technology (MindTap Course List)

A manufacturer of loose-fill cellulose insulating material provides a table showing the relationship between th...

Engineering Fundamentals: An Introduction to Engineering (MindTap Course List)

5. Identify the main components of an information system. What is a mission-critical system?

Systems Analysis and Design (Shelly Cashman Series) (MindTap Course List)

The motherboard also is called a system board. (278)

Enhanced Discovering Computers 2017 (Shelly Cashman Series) (MindTap Course List)

If your motherboard supports ECC DDR3 memory, can you substitute non-ECC DDR3 memory?

A+ Guide to Hardware (Standalone Book) (MindTap Course List)

What factors should be considered when selecting an electrode size?

Welding: Principles and Applications (MindTap Course List)