Display the names of the books sold by the bookstore which were published by a publisher from New York. List each book name only once. State it as a subquery.   Display the names of the books purchased by customer number 65378. Use a join to answer the question.   Display the names of the books purchased by customer number 65378. Use a subquery to answer the question.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

I am looking for help writing the following SQL queries

  • Display the names of the books sold by the bookstore which were published by a publisher from New York. List each book name only once. State it as a subquery.

 

  • Display the names of the books purchased by customer number 65378. Use a join to answer the question.

 

  • Display the names of the books purchased by customer number 65378. Use a subquery to answer the question.

 

  • List the names of all books which have fewer pages than the average number of pages in all books published by Lions Publishing.

 

  • List the names of all books which have fewer pages than the number of pages in every book published by Lions Publishing.

 

  • List the names of all books which have fewer pages than the number of pages in at least one book published by Lions Publishing.

 

  • List all customer information for the customer or customers who paid the least for any book in the store.
  • List all book information for the book or books which sold for the average price of all books sold by the store.
The image presents a relational database schema diagram featuring four main entities: BOOK, CUSTOMER, SALES, and PUBLISHER. Each entity is represented by a table containing various attributes, with arrows indicating relationships between them.

### BOOK
- **Attributes**:
  - **BOOKNUM**: Identifier for the book.
  - **BOOKNAME**: Name of the book.
  - **PUBYEAR**: Year the book was published.
  - **PAGES**: Number of pages in the book.
  - **PUBNAME**: Publisher's name.

### CUSTOMER
- **Attributes**:
  - **CUSTNUM**: Identifier for the customer.
  - **CUSTNAME**: Name of the customer.
  - **ADDRESS**: Customer's address.
  - **PHONE**: Customer's phone number.

### SALES
- **Attributes**:
  - **BOOKNUM**: Identifier for the book sold.
  - **CUSTNUM**: Identifier for the customer who bought the book.
  - **DATE**: Date of the sale.
  - **PRICE**: Price of the book at the time of sale.

### PUBLISHER
- **Attributes**:
  - **PUBNAME**: Name of the publisher.
  - **ADDRESS**: Publisher's address.
  - **PHONE**: Publisher's phone number.

### Relationships
- **BOOK to CUSTOMER**: Arrows indicate a relationship where a customer can purchase one or more books.
- **SALES**: Connects BOOKNUM and CUSTNUM, indicating a transactional relationship between books and customers.
- **BOOK to PUBLISHER**: A direct link from BOOK to PUBLISHER using the PUBNAME attribute, showing who published the book.

### Task
The task provided in the image is to write SQL queries to retrieve information based on this schema. This involves creating queries to extract details such as book sales, customer purchases, and publisher information, which can be documented in a Word document or similar format.
Transcribed Image Text:The image presents a relational database schema diagram featuring four main entities: BOOK, CUSTOMER, SALES, and PUBLISHER. Each entity is represented by a table containing various attributes, with arrows indicating relationships between them. ### BOOK - **Attributes**: - **BOOKNUM**: Identifier for the book. - **BOOKNAME**: Name of the book. - **PUBYEAR**: Year the book was published. - **PAGES**: Number of pages in the book. - **PUBNAME**: Publisher's name. ### CUSTOMER - **Attributes**: - **CUSTNUM**: Identifier for the customer. - **CUSTNAME**: Name of the customer. - **ADDRESS**: Customer's address. - **PHONE**: Customer's phone number. ### SALES - **Attributes**: - **BOOKNUM**: Identifier for the book sold. - **CUSTNUM**: Identifier for the customer who bought the book. - **DATE**: Date of the sale. - **PRICE**: Price of the book at the time of sale. ### PUBLISHER - **Attributes**: - **PUBNAME**: Name of the publisher. - **ADDRESS**: Publisher's address. - **PHONE**: Publisher's phone number. ### Relationships - **BOOK to CUSTOMER**: Arrows indicate a relationship where a customer can purchase one or more books. - **SALES**: Connects BOOKNUM and CUSTNUM, indicating a transactional relationship between books and customers. - **BOOK to PUBLISHER**: A direct link from BOOK to PUBLISHER using the PUBNAME attribute, showing who published the book. ### Task The task provided in the image is to write SQL queries to retrieve information based on this schema. This involves creating queries to extract details such as book sales, customer purchases, and publisher information, which can be documented in a Word document or similar format.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY