Author(name, address, URL)
Book(ISBN, title, year, price,
publisher_Name)
WrittenBy(name, address, ISBN)
Publisher(name, address, phone, URL)
Warehouse(code, phone, address)
Stocks(ISBN, WH_code, number)
Shopping-Basket(basketID, email)
basketContains(ISBN, basketID, number)
Customer(email, name, address, phone)
Q1. SELECT Book.title , Book.year
FROM Book, Author, WrittenBy, Publisher
WHERE Author.name = WrittenBy.name AND WrittenBy.name = "Mark Smith" AND Book.publisher_name = Publisher.name;
Q2. SELECT Customer.email , count(*) AS 'Number of Books'
FROM Customer, Book, , Shopping-Basket, basketContains
WHERE Customer.email = Shopping-Basket.email
GROUP BY Customer.name;
Q3 . SELECT DISTINCT Author.name
FROM Author, Book
WHERE Book.year ="2010 " AND Book.year= "2011" ;
Author(name, address, URL) Book(ISBN, title, year, price, publisher_Name) WrittenBy(name, address, ISBN) Publisher(name, address, phone, URL)...
Consider the following relation tables (fields with underline is primary keys): Author(Name, Country) Book(ISBN, Title, Publisher, Subject) Writes(Name, ISBN) Write the relational algebra for the following query: a. (2 points) Give the titles of all books with "Art" subject Solution: b. (2 points) Give the name of all authors who publish with "Harding" Solution: (2 points) Give the name of all authors who have written books with "Science" subject Solution: c. d. (3 points) Give the titles of all books...
Draw a Design Class Diagram based on the following database requirements as provided by a book publisher A. For each author, the book publisher would like to keep track of the author’s ID number, name, and contact number. i. IC number is unique for each author ii. First Name iii. Last Name iv. email B. For each book, the book publisher would like to keep track of the book’s ISBN (International Standard Book Number) and name i. ISBN is unique...
Specify relational calculus expression for the following descriptions on the Library database schema shown in Figure 4.6. a) Retrieve Publishers’ name and phone number whose books where borrowed from Baltimore Branch. b) List the book title, book id and branch name with less than 10 copies c) List customer card number, customer name, branch name and book title for books which are currently on loan. BOOK Book id Title Publisher_name BOOK_AUTHORS Book idAuthor name PUBLISHER Name Address Phone BOOK COPIES...
Design an E/R diagram for the following situation about books, authors, book publishers, book sellers, and book stores. Books have an ISBN number (the key), a name, ant type of printing (e.g. hardcover or soft cover). A book can be written by many authors and one author can write many books. Authors have an NSSF number (key) and a name. Publishers are the companies that manage the printing and production of books (e.g. ‘Prentice hall’). Publishers have a name (key),...
3. (20 POINTS) Consider the LIBRARY relational database schema below to write down the relational algebra expressions for the following two queries. No SQL statements are required. BOOK Bookid Title Publisher name BOOK AUTHORS Book id Author name PUBLISHER Name Address Phone BOOK COPIES Book d Branch Id No o copies BOOK LOANS Book Branch Id Card no Date out Due date LIBRARY BRANCH Branch Branch name Address BORROWER Card Name Address Phone 3.A.) (10 POINTS) Let the number of...
Consider the following table schemas (primary keys are underlined): Book (BookId, Title, Publishername) Book_Authors (BookId, AuthorName) Publisher (Name, Address, Phone) Book_Copies (BookId, BranchId, No_Of_Copies) Book_Loans (BookId, BranchId, CardNo, DateOut, DueDate) Library_Branch (BranchId, BranchName, Address) Borrower (CardNo, Name, Address, Phone) Write SQL statements for the following queries: List the number of copies of the book titled “The Lost Tribe” owned by each library branch and the corresponding library branch name. List the names and addresses of all borrowers who have borrowed more than 5 books...
Homework Help!! 1. Draw an ERD for the following situation. Be sure to show: entity information, attributes, identifier(s), relationships and relationship names, and cardinality Each publisher has a unique name; a mailing address and telephone number are also kept on each publisher. A publisher may publish one or more books; a book is published by exactly one publisher. A book is identified by its ISBN, and other attributes are title, price, and number of pages. Each book is written by...
Please help me on the SQL queries, thank you so much. Write a query to display the title and publisher as well as the publisher contact for each book using JOIN...USING clause. Write a query to show the first and last names of customers who have ordered cooking books. Use the WHERE clause to join the tables. Write a query to show the title, cost and ISBN of each book in the books table. If the book has been ordered,...
c) Write an ER Diagram for the following Library database. Identify all the Entities, Relationships and Attributes. Underline the primary keys and mark the different constraints. You can add an I attribute as a primary key for an entity to make t unique if necessary. Library has a number of branches in the city, each branch having a name, address and librarian. Books have title, authors and publisher. A book can have multiple authors but a single publisher. Note that same...
Write a definition for a class named Book with attributes title, price and author, where author is a Contact object and title is a String, and price is a float number. You also need to define the Contact class, which has attributes name and email, where name and email are both String. Instantiate a couple of Book objects that represents books with title, price and author (You can come up with the attributes values for each object) Write a function...