I have five boards
- Show( ShowID , Title, StartDate, Duration, RoomID, Singer)
- Concert( ConcertID , Date, Time, ShowID)
- Room( RoomID , Name, Address, Capacity)
- Ticket( TicketID , ConcertID, PositionNum, Category, Price)
- Sell( SaleID , SaleDate, TicketID, PaymentForm)
How to express in relational algebra people who have not performed a concert at the Liceu? (A very nice concert hall in Barcelona).
The relational algebra is a set of operations that describe step by step how to compute an answer on the relations, as they are defined in the relational model. Called procedural, unlike Relational Calculus which is declarative.
I've brought:
But I don't know if I'm expressing those who have held a concert at the Liceu to remove them from all the Cantadors.
Also, I don't know if it is necessary to write what I wrote under the ⋈, is it enough that the SalaID column of Show is also in the Rooms?
If I understood the question correctly, you want the
Cantador
(singers?) who have not had a concert in the "Liceu" roomNow if I can remember my relational algebra classes and get the syntax right, one solution is:
Here what happens is, the total singing group is obtained , then the singing group who have participated in the "Liceu" room and the difference between the two is calculated.
In the natural union (⋈) if the condition is omitted it means that the comparison is made for all the common columns between the 2 tables, in this case
SalaID
, therefore it is not necessary to specify it.