Question: Scenario: You are working with a bookstore database containing the following tables: - Books: Contains details about books ( BookID , BookName, Price ) .
Scenario: You are working with a bookstore database containing the following tables:
Books: Contains details about books BookID BookName, Price
Authors: Contains AuthorID and AuthorName.
BookAuthors: Links books to their authors BookID AuthorID
Customers: Contains CustomerID and CustomerName.
Sales: Contains sales information SaleID CustomerID, BookID, SaleDate
Inner Join: Write a query to display the BookName and AuthorName for all books
sold.
SQLMYSQL CODE:
Left Join: Write a query to list all books and their authors, including books that
havent been sold.
SQLMYSQL CODE:
Right Join: Write a query to display all authors and the books theyve written,
including authors who haven't written any books listed in the store.
SQLMYSQL CODE:
Cross Join: Write a query to list every combination of customers and books even if
they haven't bought the books
SQLMYSQL CODE:
UNION: Write a query to get a list of all customers and authors, ensuring no
duplicates.
SQLMYSQL CODE:
INTERSECT: Write a query to list customers who have bought books written by a
specific author look at the table to find a listed author
SQLMYSQL CODE:
EXCEPT: Write a query to list all books that have not been sold.
SQLMYSQL CODE:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
