Assignment 6
Assignment 6
FROM BookTitle
Explanation: This query will select the title and price of books from the BookTitle table where
2.
Explanation: This query will select the title of books written by J.K. Rowling and the author’s
name from the Author, BookAuthor, and BookTitle tables by joining them using their standard
IDs.
3.
GROUP BY Country.CountryName;
Explanation: This query will count the number of customers from the Customer table for each
country in the Country table and group the results by country name.
4.
GROUP BY Publisher.PublisherName;
Explanation: This query will select the publisher name from the Publisher table and the average
price of books published by that publisher from the BookTitle table. The results will be grouped
by publisher name.
5.
Explanation: This query will select the title of books ordered by customers from the US and the
first and last names of those customers from the BookTitle, BookOrder, and Customer tables.
6.
BookCategory.CategoryID;
Explanation: This query will select the distinct category names from the Category table that
7.
GROUP BY Author.AuthorName
Explanation: By joining them, this query will select the author name and the number of books
they have written from the Author, BookAuthor, and BookTitle tables using their standard IDs.
The results will be grouped by author name and filtered to show only those authors who have
(2)
Book: This table contains book information such as the title, ISBN, publication year, price,
Author: This table contains information about authors, such as the name, address, city, state,
BookAuthor: This table represents the many-to-many relationship between the Book and
Author tables. It contains the ISBN and author ID for each book and author combination.
Customer: This table contains customer information such as the name, address, city, state,
Order: This table represents the one-to-many relationship between the Customer and Order
tables. It contains information about customer orders, such as the order ID, order date, and
customer ID.
The Book table has a foreign key constraint referencing the Publisher table's primary key to
The BookAuthor table has foreign key constraints referencing the Book and Author tables'
primary keys to establish a many-to-many relationship. Each book can have multiple authors,
The Order table has a foreign key constraint referencing the Customer table's primary key to
The database contains tables representing entities such as books, publishers, authors, customers,
and orders. These tables are related through various relationships, such as one-to-many and
many-to-many.