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

9th Edition
Philip J. Pratt
Publisher: Course Technology Ptr
ISBN: 9781111527273

#### Solutions

Chapter
Section ### A Guide to SQL

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;

### Explanation of Solution

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...

### 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
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

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

Engineering Fundamentals: An Introduction to Engineering (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)

List characteristics of a smartphone.

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