Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Consider a 'Book-Shop' database of three tables as given below: Books (isbn, title, author, qty_in stock, price, year published) Customers (cid, cname, address) Orders
Consider a 'Book-Shop' database of three tables as given below: Books (isbn, title, author, qty_in stock, price, year published) Customers (cid, cname, address) Orders (ordernum, isbn, cid, cardnum, aty, order date, ship_date) Assume your own data for the above tables and write queries as given below: 1. Write SQL statements for creation of all the three tables. 2. Write SQL statement to search from the table books, view only the columns- author name, title and ISBN 3. Write SQL statement view customer name and the books he got in a horizontal manner like CustomerName - All books [with titles] each customer one got 4. Write SQL statement view the orders for different authors in a horizontal manner like OrderNum- Authors 5. Write SQL statement view customer name, address, order qty, order date, ship date 6. Write SQL statement view total books bought by each customer [with customer name] 7. Write SQL statement view to find total books published in year 2018 [assume 2018 to be one of the field values in Books table] 8. Write SQL statement to view all the books which have been shipped. 9. Write SQL statement view customer name, book title, book price, year_published 10. Write SQL statement to find out qty of books ordered for each author
Step by Step Solution
★★★★★
3.46 Rating (159 Votes )
There are 3 Steps involved in it
Step: 1
Create Database BookShop 1 Create Table BooksISBN Varchar25Title Varchar50 Author Varchar25Qtyinstoc...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