Question
Book Table has ISBN, TITLE, Author, Publisher. Subject_Code,Shelf_Location, Fiction as columns Using MySQL /*Query 1*/ /*Display ISBN, Title, and Subject_Code of books that have the
Book Table has ISBN, TITLE, Author, Publisher. Subject_Code,Shelf_Location, Fiction as columns
Using MySQL
/*Query 1*/ /*Display ISBN, Title, and Subject_Code of books that have the same subject code as the book 'The Art of Walt Disney'. The output should be sorted by title from a->z. This query must be solved by using a subquery. No hard coded values are allowed in the statement except the book title 'The Art of Walt Disney'.Should return 4 books*/
SELECT ISBN, Title, Subject_Code FROM Book Where Subject_Code IN (SELECT Subject_Code FROM book WHERE Title = 'The Art of Walt Disney') ORDER BY Title;
/*Query 2*/ /*Solve Query 1 again by using a table join.Should return 4 books*/
/*Query 3*/ /*Update the Shelf_Location to KD-2222 for books of a Subject_Code that has the least number of books. For example, if ART and PHL subjects each contains only two books and all other subjects have three or more books, then the Shelf_Location of four books of ART and PHL should be updated. Hint: subquery*/
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started