plz no handwriting or photos thanks alot Using the following relations to write
ID: 3712752 • Letter: P
Question
plz no handwriting or photos thanks alot
Using the following relations to write SQL statement that follows:
Author (Author_ID, FIRST_NAME, LAST_NAME)
Book_authors_books (ISBN, Author_ID)
Book_descriptions (ISBN, Title, Price, Publisher, Pub_date, Edition, Pages)
1- Retrieve all the books that cost less than 35.
2- Retrieve all the authors in alphabetical order(A-Z).
3- Retrieve all the possible information about the most expensive book that published by "New Math" publisher (the data should include authors).
4- Increase price value by 10% of all books that published in 2015 (use update).
Explanation / Answer
Answer)
Author (Author_ID, FIRST_NAME, LAST_NAME)
Book_authors_books (ISBN, Author_ID)
Book_descriptions (ISBN, Title, Price, Publisher, Pub_date, Edition, Pages)
1- Retrieve all the books that cost less than 35.
select * from Book_descriptions where Price < 35;
2- Retrieve all the authors in alphabetical order(A-Z).
select * from Author ORDER BY FIRST_NAME;
3- Retrieve all the possible information about the most expensive book that published by "New Math" publisher (the data should include authors).
SELECT *
FROM ((Author
INNER JOIN Book_authors_books ON Author.Author_ID = Book_authors_books.Author_ID)
INNER JOIN Book_descriptions ON Book_authors_books.ISBN = Book_descriptions.ISBN) where Book_descriptions.Publisher ='New Math' and price = (SELECT MAX(Price) from Book_descriptions);
4- Increase price value by 10% of all books that published in 2015 (use update).
UPDATE Book_descriptions
SET price = price*1.1
WHERE Pub_date=2015;
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.