Relational Algebra Syntax Question

GilTea

New member
Joined
Feb 12, 2016
Messages
1
Hi, I have a question on how the syntax of a relational algebra statement should be handled.

Consider the following:

I am searching the following relation for a book named 'SQL for Dummies' that is currently available:

The following tables form part of a Library database held in an RDBMS:

Book (ISBN, title, edition, year)
BookCopy (copyNo, ISBN, available)
Borrower (borrowerNo, borrowerName, borrowerAddress)
BookLoan (copyNo, dateOut, dateDue, borrowerNo)


From the examples in my book I have been able to come up with two different ways I could think it maybe handled:

1) σ title = ‘SQL for Dummies’ & σ available = TRUE (πISBN, title(Book)) ⨝ Book.ISBN = BookCopy.ISBN (πISBN, available(BookCopy))


2) πISBN, title, available(Book ⨝ Book.ISBN = BookCopy.ISBN (BookCopy)(σ title = ‘SQL for Dummies’(Book))(σ available = TRUE (BookCopy)))



Does anyone know if either of these two examples is correct, or if I am completely out to lunch?

Kind regards,

Gil
 
Top