Write a query to display the patron ID, first and last name of all patrons who have never checked out any book. Sort the result by patron last name and then first name (Figure P7.101). FIGURE P7.101 PATRONS WHO NEVER CHECKED OUT A BOOK

Database Systems: Design, Implemen...

13th Edition
Carlos Coronel + 1 other
Publisher: Cengage Learning
ISBN: 9781337627900

Chapter
Section

Database Systems: Design, Implemen...

13th Edition
Carlos Coronel + 1 other
Publisher: Cengage Learning
ISBN: 9781337627900
Chapter 7, Problem 101P
Textbook Problem
174 views

Write a query to display the patron ID, first and last name of all patrons who have never checked out any book. Sort the result by patron last name and then first name (Figure P7.101).FIGURE P7.101 PATRONS WHO NEVER CHECKED OUT A BOOK

Program Plan Intro

SELECT statement:

It is used to retrieve information from the table or database. The syntax for the “SELECT” statement is given below:

Syntax:

SELECT * FROM table_Name;

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;

LEFT JOIN keyword:

“LEFT JOIN” keyword is used to return all the records from the left side table and also return the matched records from the right side table.

Syntax:

SELECT col_Name FROM table_Name1 LEFT JOIN table_Name2 ON table_Name1.col_Name = table_Name2.col_Name;

Explanation of Solution

Query:

Query to view the patrons who never checked out a book is as follows:

SELECT PATRON.PAT_ID, PATRON.PAT_FNAME, PATRON.PAT_LNAME

FROM PATRON LEFT JOIN CHECKOUT ON PATRON.PAT_ID = CHECKOUT.PAT_ID

WHERE (((CHECKOUT.CHECK_NUM) Is Null))

ORDER BY PATRON.PAT_LNAME, PATRON...

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
What is a DBMS, and what are its functions?

Database Systems: Design, Implementation, & Management

Explain the major diameter of a thread.

Precision Machining Technology (MindTap Course List)

What are some of the characteristics of a virtual team?

Principles of Information Systems (MindTap Course List)

What is the cylinder taper?

Automotive Technology: A Systems Approach (MindTap Course List)

For Problems 16.44 through 16.48, discuss how you would create the solid model of the given objects. See Exampl...

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

How has technology changed in recent years? Provide of traditional, evolving and emerging technology.

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

In Sample Problem 5.5, compute the tension TAD using one scalar equilibrium equation.

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

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

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

What types of health risks might nonergonomic use of a mobile device pose?

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

What is the purpose of grooving a joint before welding on thick plate?

Welding: Principles and Applications (MindTap Course List)

What type of network combines fiber with coax?

Network+ Guide to Networks (MindTap Course List)