BuyFind*arrow_forward*

9th Edition

Philip J. Pratt

Publisher: Course Technology Ptr

ISBN: 9781111527273

Chapter 4, Problem 19CAT

Textbook Problem

33 views

How many current reservations does Colonial Adventure Tours have and what is the total number of persons for all reservations?

Program Plan Intro

**“SELECT” command:**

The “SELECT” command is used to retrieve data in a database.

**Syntax for selecting values from the table is as follows:**

SELECT STUDENT_ID FROM STUDENT;

- The given query is used to display each student ID from “STUDENT” table.

**“SUM” function:**

- It is the one function of aggregate function.
- The “SUM” function is used to compute the total of the values in a column.

**Example:**

The example for “SUM” function is given below:

SELECT SUM(MARK_CREDIT) FROM STUDENT;

The above query is used to display the sum of all students mark credit from “STUDENT” table using “SUM” function.

**“COUNT” function:**

- It is the one function of aggregate function.
- The “COUNT” function is used to compute the number of rows in a table.

**Example:**

The example for “COUNT” function is given below:

SELECT COUNT(*) FROM STUDENT WHERE MARK_CREDIT >= 90;

The above query is used to display the number of students whose mark credit is greater or equal to “90” by using “COUNT” function.

- From the given query, the asterisk (*) represent any column.
- User can also count the number of rows in a query by selecting a particular column instead of using the asterisk.
- The below example is as follows
SELECT COUNT(STUDENT_ID) FROM STUDENT WHERE MARK_CREDIT >= 90;

- The below example is as follows

**SQL Query to compute the number of reservations and total number of persons in “RESERVATION” table:**

The SQL query to compute the number of reservations and total number of persons in the “RESERVATION” table is given below:

SELECT COUNT(*), SUM(NUM_PERSONS) FROM RESERVATION;

**Explanation:**

The above query is used to compute the number of reservations and total number of persons in the “RESERVATION” table.

- Based on the information provided in “Figure 1-7” of chapter 1:
- User can create a “RESERVATION” table with their corresponding data type by using “CREATE” command...

A Guide to SQL

Show all chapter solutions

Ch. 4 - Describe the basic form of the SQL SELECT command.Ch. 4 - How do you form a simple condition?Ch. 4 - How do you form a compound condition?Ch. 4 - In SQL, which operator do you use to determine...Ch. 4 - How do you use a computed column in SQL? How do...Ch. 4 - In which clause would you use a wildcard in a...Ch. 4 - What wildcards are available in Oracle, and what...Ch. 4 - How do you determine whether a column contains one...Ch. 4 - How do you sort data?Ch. 4 - How do you sort data on more than one sort key?...

Ch. 4 - How do you sort data in descending order?Ch. 4 - What are the SQL aggregate functions?Ch. 4 - How do you avoid including duplicate values in a...Ch. 4 - What is a subquery?Ch. 4 - How do you group data in an SQL query?Ch. 4 - When grouping data in a query, how do you restrict...Ch. 4 - How do you find rows in which a particular column...Ch. 4 - Use the Internet to research the SQL [charlist]...Ch. 4 - List the item number, description, and price for...Ch. 4 - List all rows and columns for the complete ORDERS...Ch. 4 - List the names of customers with credit limits of...Ch. 4 - List the order number for each order placed by...Ch. 4 - List the number and name of each customer...Ch. 4 - List the item number and description of each item...Ch. 4 - List the item number, description, and number of...Ch. 4 - List the item number, description, and on-hand...Ch. 4 - List the item number, description, and on-hand...Ch. 4 - Use the IN operator to list the item number and...Ch. 4 - Find the number and name of each customer whose...Ch. 4 - List all details about all items. Order the output...Ch. 4 - List all details about all items. Order the output...Ch. 4 - How many customers have balances that are more...Ch. 4 - Find the total of the balances for all customers...Ch. 4 - List the item number, description, and on-hand...Ch. 4 - What is the price of the least expensive item in...Ch. 4 - What is the item number, description, and price of...Ch. 4 - List the sum of the balances of all customers for...Ch. 4 - List the sum of the balances of all customers for...Ch. 4 - List the item number of any item with an unknown...Ch. 4 - List the item number and description of all items...Ch. 4 - TAL Distributors is considering discounting the...Ch. 4 - List the last name of each guide that does not...Ch. 4 - List the trip name of each trip that has the type...Ch. 4 - List the trip name of each trip that has the...Ch. 4 - List the trip name of each trip that has the type...Ch. 4 - List the customer number, customer last name, and...Ch. 4 - Repeat Exercise 5 and sort the records by state in...Ch. 4 - How many trips are in the states of Maine (ME) or...Ch. 4 - How many trips originate in each state?Ch. 4 - How many reservations include a trip price that is...Ch. 4 - How many trips of each type are there?Ch. 4 - Colonial Adventure Tours calculates the total...Ch. 4 - Find the name of each trip containing the word...Ch. 4 - List the guides last name and guides first name...Ch. 4 - What is the average distance and the average...Ch. 4 - Display the different seasons in which trips are...Ch. 4 - List the reservation IDs for reservations that are...Ch. 4 - What is the longest distance for a biking trip?Ch. 4 - For each trip in the RESERVATION table that has...Ch. 4 - How many current reservations does Colonial...Ch. 4 - List the reservation ID and trip ID for all trips...Ch. 4 - List the owner number, last name, and first name...Ch. 4 - List the complete LOCATION table (all rows and all...Ch. 4 - List the last name and first name of every owner...Ch. 4 - List the last name and first name of every owner...Ch. 4 - List the location number and unit number for every...Ch. 4 - List the location number and unit number for every...Ch. 4 - List the unit number for every condo with two...Ch. 4 - List the condo ID for every condo with a condo fee...Ch. 4 - List the unit number for every condo in location...Ch. 4 - Labor is billed at the rate of 35 per hour. List...Ch. 4 - List the owner number and last name for all owners...Ch. 4 - List the location number, unit number, square...Ch. 4 - How many one-bedroom condos are located at each...Ch. 4 - Calculate the total condo fees Solmaris receives...Ch. 4 - There are two ways to create the query in Step 11....Ch. 4 - What WHERE clause would you use to find all...

Find more solutions based on key concepts

Show solutions What other potential problems can you anticipate as the team moves forward with its first agile project? What c...

Fundamentals of Information Systems

In risk management strategies, why must periodic review be part of the process?

Principles of Information Security (MindTap Course List)

List and describe the different types of databases.

Database Systems: Design, Implementation, & Management

Use the contents of Figure 2.1 to work Problems 13 Given the business rule(s) you wrote in Problem 1, create th...

Database Systems: Design, Implementation, & Management

What type of person creates, uses, and disseminates knowledge? a. information worker b. knowledge worker c. dom...

Fundamentals of Information Systems

Name three types of workpiece features that are well suited to using a rotary positioning device.

Precision Machining Technology (MindTap Course List)

The grain size distributions of four soils A, B, C, and D are shown in Figure 2.26. Without carrying out any co...

Fundamentals of Geotechnical Engineering (MindTap Course List)

What are some of the social implications of the use of smartphones by an increasing percentage of the worlds po...

Principles of Information Systems (MindTap Course List)

Technician A says that bearings that take radial loads are called Torrington washers. Technician B says that be...

Automotive Technology: A Systems Approach (MindTap Course List)

Comparative Analysis: Under Armour, Inc., versus Columbia Sportswear Refer to the 10-K reports of Under Armour,...

Cornerstones of Financial Accounting

Repeat Problem 2.14 with the following values: Gs = 2.75, temperature of water = 21C, t = 88 min, and L = 11.7 ...

Principles of Geotechnical Engineering (MindTap Course List)

Explain what is meant by pressure and stress and give examples from everyday life.

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

-19 Derive the equations of the deflect ion curve for a simple beam AB loaded by a couple M0acting at distance ...

Mechanics of Materials (MindTap Course List)

What is an unnormalized design, and how do you convert an unnormalized to 1NF? In your answer, specific pages a...

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

Which two communities of interest are usually associated with contingency planning? Which community must give a...

Management Of Information Security

The center of gravity of the 850-N man is at G. If the man pulls on the rope with a 388-N force, determine the ...

International Edition---engineering Mechanics: Statics, 4th Edition

How can a 230/460-volt motor be used as a part winding motor?

Electric Motor Control

What is the total current consumption of the track lighting and recessed luminaires above the fireplace? Show y...

EBK ELECTRICAL WIRING RESIDENTIAL

Several systems are described below. For each system, go through each of the following adjectives, and determin...

Fundamentals of Chemical Engineering Thermodynamics (MindTap Course List)

A 24-rn-diameter trammel screen rotating at 4 rpm is 7.6 m long and set at an angle (ß) of 15’. The feed rate i...

Solid Waste Engineering

Select a W-shape for the following conditions: Beam spacing = 5 ft-6 in. Span length = 30 ft Slab thickness = 4...

Steel Design (Activate Learning with these NEW titles from Engineering!)

Define the purpose of the final drive gears.

Automotive Technology

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

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

List characteristics of a smartphone.

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

Why must the gas pressure be released and the adjusting screw backed out when welding is finished and the cylin...

Welding: Principles and Applications (MindTap Course List)

Which NGFW feature allows a network admin to restrict traffic generated by a specific game? a. Content filter b...

Network+ Guide to Networks (MindTap Course List)