Homework Solution: I need help answering these questions. I've gotten the first one and am having trouble with ones after. If I see how a few a…

    I need help answering these questions. I've gotten the first one and am having trouble with ones after. If I see how a few are done I will be able to better understand it. Consider a library database with the following schema (where primary keys are bolded): Book(bookID, ISBN, title, author, publish-year, category) Member(memberID, lastname, firstname, address, phone-number, limit) CurrentLoan(memberIDbookID, loan-date, due-date) History(memberIDbookIDloan-date, return-date) Members can borrow books from the library. The number of books they can borrow is limited by the “limit” field of the Member relation. The category of a book includes fiction, non-fiction, children’s and reference. The CurrentLoan table represents the information about books that are currently checked out. When the book is returned to the library, the record will be removed from CurrentLoad relation, and will be inserted into History relation with the return-date. A library may have more than one copy of the same book, in which case each copy has its own bookID, but all copies share the same ISBN. Express each of the following tasks in relational algebra. (5 pts) Find the ISBN and title of all the books authored Arthur Miller. (8 pts) List the bookID and title of all the books that are currently checked out by John Smith. Do not use any natural join in this query. (8 pts) Find the first name and last name of the members who are either currently borrowing book “Da Vinci Code” or have borrowed it in the past. (6 pts) Find the memberID, first name, and last name of the members who have never borrowed any books. (8 pts) List the first and last names of members who have borrowed (either currently or in the past) all the books in the library that are authored by Arthur Miller. If some books authored by Arthur Miller have multiple copies, he or she must have borrowed at least one copy of each of Arthur Miller’s books. (5 pts) Find the total number of books for each category (write a single query for this question).

    Expert Answer

     
    Given relation is: Book(bookID, ISBN, title, author, publish-year, category)

    I insufficiency acceleration obedient these scrutinys. I’ve gotten the ceemost uncompounded and am having disturbance with uncompoundeds succeeding. If I attpurpose how a rare are duncompounded I achieve be able to meliorate discern it.

    Consider a library database with the aftercited schema (where primary keys are bolded):

    Book(bookID, ISBN, heading, perpetrator, publish-year, state)

    Member(memberID, ultimatename, ceemostname, discourse, phone-number, boundary)

    CurrentLoan(memberIDbookID, loan-date, due-date)

    History(memberIDbookIDloan-date, return-date)

    Members can hypothecate capacitys from the library. The compute of capacitys they can hypothecate is boundaryed by the “limit” ground of the Member narration. The state of a capacity includes creation, non-fiction, children’s and everyusion. The CurrentLoan board represents the instruction abextinguished capacitys that are currently checked extinguished. When the capacity is returned to the library, the annals achieve be removed from CurrentLoad narration, and achieve be inserted into History narration with the return-date. A library may confess further than uncompounded representation of the identical capacity, in which occurrence each representation has its confess capacityID, except every copies distribute the identical ISBN. Express each of the aftercited tasks in relational algebra.

    (5 pts) Find the ISBN and heading of every the capacitys perpetratored Arthur Miller.

    (8 pts) List the capacityID and heading of every the capacitys that are currently checked extinguished by John Smith. Do referable attributable attributable attributable correction any original link in this scrutiny.

    (8 pts) Find the ceemost designate and ultimate designate of the members who are either currently hypothecateing capacity “Da Vinci Code” or confess hypothecateed it in the late.

    (6 pts) Find the memberID, ceemost designate, and ultimate designate of the members who confess never hypothecateed any capacitys.

    (8 pts) List the ceemost and ultimate designates of members who confess hypothecateed (either currently or in the late) every the capacitys in the library that are perpetratored by Arthur Miller. If some capacitys perpetratored by Arthur Miller confess multiple copies, he or she must confess hypothecateed at definite uncompounded representation of each of Arthur Miller’s capacitys.

    (5 pts) Find the whole compute of capacitys ce each state (transcribe a uncompounded scrutiny ce this scrutiny).

    Expert Retort

     

    Given narration is:
    Book(bookID, ISBN, heading, perpetrator, publish-year, state)
    Member(memberID, ultimatename, ceemostname, discourse, phone-number, boundary)
    CurrentLoan(memberID, capacityID, loan-date, due-date)
    History(memberID, capacityID, loan-date, return-date)

    Find the ISBN and heading of every the capacitys perpetratored Arthur Miller?

    select ISBN, heading from Capacity where perpetrator=’Arthur Miller’;

    List the capacityID and heading of every the capacitys that are currently checked extinguished by John Smith. Do referable attributable attributable attributable correction any original link in this scrutiny.

    select B.bookID, B.heading from Capacity B,Member M,CurrentLoan C where B.bookID=C.bookID and M.memberID=C.memberID and M.firstname=’John Smith’;

    Find the ceemost designate and ultimate designate of the members who are either currently hypothecateing capacity “Da Vinci Code” or confess hypothecateed it in the late.

    select M.firstname, M.lastdesignate from Capacity B,Member M,CurrentLoan C where B.bookID=C.bookID and M.memberID=C.memberID and B.title=’Da Vinci Code’;

    Find the whole compute of capacitys ce each state ?
    select isbn, capacitytitle, solidity(occurrence when status=’available’ then 1 else 0 purpose) as utility, number(*) as whole
    from Capacity;
    group by isbn, capacitytitle