BuyFindarrow_forward

A Guide to SQL

9th Edition
Philip J. Pratt
Publisher: Course Technology Ptr
ISBN: 9781111527273
Chapter 5, Problem 17CAT
Textbook Problem
116 views

Repeat Exercise 8 but list the guide name only once and sort the guide names in order by last name.

Program Plan Intro

DISTINCT Keyword: “DISTINCT” keyword is used to avoid redundant data (removing duplicate values) from a column. The syntax for “DISTINCT” keyword is as follows:

Syntax:

SELECT DISTINCT column_Name FROM table_Name;

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;

ORDER BY Clause:

SQL contains “ORDER BY” clause in order to sort rows. The values get sorted in ascending as well as descending order. The keyword used to sort values in ascending order is “ASC” and for descending order is “DESC”. By default, it sorts values by ascending order.

Syntax:

SELECT column_Name1, column_Name2 FROM table_Name ORDER BY column_Name2;

Explanation of Solution

SQL code:

The SQL code to find out the last and first name of a guide who can lead a paddling trip is as follows.

SELECT DISTINCT(LAST_NAME), FIRST_NAME FROM GUIDE G, TRIP T, TRIP_GUIDES TGs WHERE T.TRIP_ID = TGs.TRIP_ID AND G.GUIDE_NUM = TGs.GUIDE_NUM AND TYPE = 'Paddling' ORDER BY LAST_NAME;

Explanation:

The query displays “LAST_NAME”, “FIRST T.TRIP_ID = TGs...

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

Chapter 5 Solutions

A Guide to SQL
Show all chapter solutions
add
Ch. 5 - Which rows are included in an inner join? What...Ch. 5 - Which rows are included in a left outer join? What...Ch. 5 - Which rows are included in a right outer join?...Ch. 5 - What is the formal name for the product of two...Ch. 5 - Use the Internet to find definitions for the terms...Ch. 5 - For each order, list the order number and order...Ch. 5 - For each order placed on October 15, 2015, list...Ch. 5 - For each order, list the order number, order date,...Ch. 5 - Use the IN operator to find the number and name of...Ch. 5 - Repeat Exercise 4, but this time use the EXISTS...Ch. 5 - Find the number and name of each customer that did...Ch. 5 - For each order, list the order number, order date,...Ch. 5 - Repeat Exercise 7, but this time order the rows by...Ch. 5 - Use a subquery to find the rep number, last name,...Ch. 5 - Repeat Exercise 9, but this time do not use a...Ch. 5 - Find the number and name of each customer that...Ch. 5 - List the item number, description, and category...Ch. 5 - List the order number and order date for each...Ch. 5 - List the order number and order date for each...Ch. 5 - List the order number and order date for each...Ch. 5 - List the order number and order date for each...Ch. 5 - List the order number and order date for each...Ch. 5 - List the item number, description, unit price, and...Ch. 5 - If you used ALL in Exercise 18, repeat the...Ch. 5 - For each rep, list the customer number, customer...Ch. 5 - For each reservation, list the reservation ID,...Ch. 5 - For each reservation for customer Ryan Goff, list...Ch. 5 - List the trip name of each trip that has Miles...Ch. 5 - List the trip name of each trip that has the type...Ch. 5 - For each reservation that has a trip date of July...Ch. 5 - List the reservation ID, trip ID, and trip date...Ch. 5 - Repeat Exercise 6, but this time use the EXISTS...Ch. 5 - Find the guide last name and guide first name of...Ch. 5 - Repeat Exercise 8 but use aliases for the table...Ch. 5 - List the trip IDs and trip names (or each pair of...Ch. 5 - Find the trip name of all reservations for hiking...Ch. 5 - List the number and name of each customer that...Ch. 5 - List the number and name of each customer that...Ch. 5 - Find the trip ID and trip name for each trip whose...Ch. 5 - Find the trip ID and trip name for each trip whose...Ch. 5 - Display the trip ID, trip name, and reservation ID...Ch. 5 - Repeat Exercise 8 but list the guide name only...Ch. 5 - Repeat Exercise 10, but this time list only hiking...Ch. 5 - For every condo, list the location number, unit...Ch. 5 - For every completed or open service request for...Ch. 5 - For every service request for janitorial work,...Ch. 5 - List the first and last names of all owners who...Ch. 5 - Repeat Exercise 4, but this time use the EXISTS...Ch. 5 - List the unit numbers of any pair of condos that...Ch. 5 - List the square footage, owner number, owner last...Ch. 5 - Repeat Exercise 7, but this time include only...Ch. 5 - List the location number, unit number, and condo...Ch. 5 - List the location number, unit number, and condo...Ch. 5 - List the location number, unit number, and condo...Ch. 5 - Find the service ID and condo ID for each service...Ch. 5 - Find the service ID and condo ID for each service...Ch. 5 - List the condo ID, square footage, owner number,...Ch. 5 - Repeat Exercise 14, but this time be sure each...Ch. 5 - Repeat Exercise 15 using a different SQL command...

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
Show solutions add
Explain how the computer controls the air-fuel ratio on an EFI system.

Automotive Technology: A Systems Approach (MindTap Course List)

Determine the mass moment of inertia of a steel shaft that is 1 m long and has a diameter of 5 cm. Determine th...

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

_____ occurs when a persons attention is diverted, such as by talking on a mobile phone.

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)

How can cutting torch tip seals be repaired?

Welding: Principles and Applications (MindTap Course List)

What process is used to establish a TCP connection?

Network+ Guide to Networks (MindTap Course List)