BuyFindarrow_forward

A Guide to SQL

9th Edition
Philip J. Pratt
ISBN: 9781111527273
Textbook Problem

List the location number, unit number, and condo fee for condos whose owners live in Bowton or own one-bedroom condos.

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.

UNION set operator:

The UNION set operator is used to combine the output of two or more than two queries and produce a result. The produced result contains unique values.

Syntax: QUERY UNION QUERY;

Program Explanation

SQL code:

The SQL code to list the location number, unit number and fee for condo for every owners who live in Bowton or who own a single bedroom condo is as follows.

SELECT LOCATION_NUM, UNIT_NUM, CONDO_FEE FROM CONDO_UNIT CU, OWNER O WHERE CU.OWNER_NUM = O.OWNER_NUM AND CITY = 'Bowton' UNION SELECT LOCATION_NUM, UNIT_NUM, CONDO_FEE FROM CONDO_UNIT WHERE BDRMS = 1;

Explanation:

The outer query selects “LOCATION_NUM”, “UNIT_...

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

Additional Engineering Solutions

Find more solutions based on key concepts

Show solutions add

How do you translate business rules into data model components?

Database Systems: Design, Implementation, & Management

When is the BC plan used? How do you determine when to use the IR, DR, and BC plans?

Principles of Information Security (MindTap Course List)

What can cause scratches on the surface of a workpiece?

Precision Machining Technology (MindTap Course List)

Calculate the heat-transfer rate through a 24 ft2 door with. U=0.75Btuhft2F The indoor and outdoor temperatures...

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