# Write a query to display the author ID, author last name, book title, checkout date, and patron last name for all the books written by authors with the last name “Bruer” that have ever been checked out by patrons with the last name “Miles.” Sort the results by check out date (Figure P7.100). FIGURE P7.100 BOOKS BY AUTHOR FOR PATRON “MILES”

### 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 100P
Textbook Problem
30 views

## Write a query to display the author ID, author last name, book title, checkout date, and patron last name for all the books written by authors with the last name “Bruer” that have ever been checked out by patrons with the last name “Miles.” Sort the results by check out date (Figure P7.100).FIGURE P7.100 BOOKS BY AUTHOR FOR PATRON “MILES”

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;

INNER JOIN keyword:

“INNER JOIN” keyword is used to select all the matching records of both the table.

Syntax:

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

### Explanation of Solution

Query:

Query to view the author last name “Bruer” have ever been checked out by patrons with the last name “Miles” is as follows:

SELECT AUTHOR.AU_ID, AUTHOR.AU_LNAME, BOOK.BOOK_TITLE, CHECKOUT.CHECK_OUT_DATE, PATRON.PAT_LNAME

FROM AUTHOR INNER JOIN (PATRON INNER JOIN ((BOOK INNER JOIN CHECKOUT ON BOOK.BOOK_NUM = CHECKOUT.BOOK_NUM) INNER JOIN WRITES ON BOOK.BOOK_NUM = WRITES.BOOK_NUM) ON (PATRON.PAT_ID = CHECKOUT.PAT_ID) AND (PATRON.PAT_ID = BOOK.PAT_ID)) ON AUTHOR.AU_ID = WRITES.AU_ID

WHERE (((AUTHOR...

### 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
Briefly describe the primary purpose of sawing machines.

Precision Machining Technology (MindTap Course List)

Why is important to know differential calculus?

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

Provide suggestions for reducing input volume.

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

What is a managerial control?

Management Of Information Security

When you enter an area with Wi-Fi, do you configure your mobile device to connect to the Wi-Fi? Why or why not?

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)

Who must be provided with safety data sheets (SDSs)?

Welding: Principles and Applications (MindTap Course List)