Questions:(1,4,5,6,11,13,14) Henry Books Use MySQL and the Henry Books database
ID: 3710076 • Letter: Q
Question
Questions:(1,4,5,6,11,13,14)
Henry Books Use MySQL and the Henry Books database (Figures 1-4 through 1-7 in Chapter 1) to complete the following exercises. Use the notes at the end of Chapter 3 to print your output if directed to do so by your instructor. 1. For each book, list the book code, book title, publisher code, and publisher name. Order the results by publisher name. For each book published by Plume, list the book code, book title, and price. List the book title, book code, and price of each book published by Plume that has a book price of at least $14. List the book code, book title, and units on hand for each book in branch number 4. 159 2. 3. 4. 5. List the book title for each book that has the type PSY and that is published by Jove 6. Find the book title for each book written by author number 18. Use the IN operator in your 7. Repeat Exercise 6, but this time use the EXISTS operator in your formulation. Find the book code and book title for each book located in branch number 2 and written by List the book codes for each pair of books that have the same price. (For example, one such first book code listed should be the major sort key, and the second book code should be the 10. Find the book title, author last name, and units on hand for each book in branch number 4 12. Find the book code and book title for each book whose price is more than $10 or that was 13. Find the book code and book title for each book whose price is more than $10 and that was 14. Find the book code and book title for each book whose price is more than $10 but that was 15. Find the book code and book title for each book whose price is greater than the book price 16. Find the book code and book title for each book whose price is greater than the price of at 8. author 20. 9. pair would be book 0200 and book 7559, because the price of both books is $8.00.) The minor sort key. 11. Repeat Exercise 10, but this time list only paperback books. published in Boston. published in Boston. not published in Boston. of every book that has the type HOR. least one book that has the type HOR. List the book code, book title, and units on hand for each book in branch number 2. Be sure each book is included, regardless of whether there are any copies of the book currently on hand in branch 2. Order the output by book code. 17.Explanation / Answer
Solution:
Note: The first four subparts have been answered as per Chegg guidelines, please repost others.
NOTE 2: I think Book table is missing in the questions, I have used it on assumption, please modify accordingly.
1)
SELECT BOOK_CODE, BOOK_TITLE, PUBLISHER_CODE, PUBLISHER_NAME FROM INVENTORY INNER JOIN BOOK ON INVENTORY.BOOK_CODE= BOOK.BOOK_CODE INNER JOIN PUBLISHER ON PUBLISHER.PUBLISHER_CODE= BOOK.PUBLISHER_CODE ORDER BY PUBLISHER_NAME
4)
SELECT BOOK_CODE, BOOK_TITLE, SUM(ON_HAND) AS units FROM INVENTORY INNER JOIN BOOK ON INVENTORY.BOOK_CODE= BOOK.BOOK_CODE INNER JOIN BRANCH ON INVENTORY.BRANCH_NUM= BRANCH.BRANCH_NUM WHERE BRANCH_NUM= 4 GROUP BY BOOK_CODE
5)
SELECT BOOK_TITLE FROM BOOK INNER JOIN PUBLISHER ON PUBLISHER.PUBLISHER_CODE= BOOK.PUBLISHER_CODE WHERE TYPE= 'PSY' AND PUBLISHER_NAME= 'Jove Publication' GROUP BY BOOK_CODE
6)
SELECT BOOK_TITLE FROM BOOK INNER JOIN WROTE ON WROTE.BOOK_CODE= BOOK.BOO_CODE INNER JOIN AUTHOR ON AUTHOR.AUTHOR_NUM= WROTE.AUTHOR_NUM WHERE AYTHOR_NUM IN (18) GROUP BY BOOK_CODE
I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.