ANY HELP PLEASE, PLEASE ANSWER ALL QUESTIONS.. THANKS Assume that peerAdvisorID
ID: 3731827 • Letter: A
Question
ANY HELP PLEASE, PLEASE ANSWER ALL QUESTIONS.. THANKS
Assume that peerAdvisorID is a reference to another student (the studentid of another student). Publisher(publishername, address, city, state)
Book(isbn, title, datePublished, publishername)
BookCopy(bookID, isbn, condition, datePurchased, price)
BookCheckout(bookID, studentID, dateIn, dateOut)
Student(studentID, firstname, lastname, city, state, email, peerAdvisorID)
Write relational algebra commands to do the following tasks.
1.Output the First Name and Last Name for all students from New Jersey.
2.Output the bookid, title, and condition of all book copies.
3.Output the first and last name of students along with the title of every book they have checked out.
4.Output the average price of all books.Output the average price of books checked out by a student from New Jersey.
5.Output the name of each publisher and the number of books published by that publisher
6.Output the names of all students and the name of their peer advisor.
7.Output the bookid for all book copies that have been checked out by every student.
8.Output the bookid for all book copies that have never been checked out by a student.
Explanation / Answer
Dear,
1) Find First Name and Last Name for all students from New Jersey.
Firstname,lastname(city="New Jersey")(student)
2) Find bookid, title, and condition of all book copies
Bookid,title,condtion(Book.isbn=Bookcopy.isbn(Book*Bookcopy))
3) Find first and last name of students along with the title of every book they have checked out
Firstname,lastname,title(student.studentid=bookcheckout.studentid(sudent*bookcheckout)
^ bookcheckout.bookid=Bookcopy.bookid(Bookcopy*bookcheckout)
^ Bookcopy.isbn=Book.isbn(Bookcopy*Book))
4)Find average price of all books
Avg(price)(bookcopy)
Note: Only one question per post, as per the Cramster rule. Please Ask remaining Questions in other post.