Question: 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,

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

1 Expert Approved Answer
Step: 1 Unlock

Create Database BookShop 1 Create Table BooksISBN Varchar25Title Varchar50 Author Varchar25Qtyinstoc... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Computer Engineering Questions!