Ok, I'm having trouble with this particular assignment, specifically this final question:
Quote:
• branch( branchNo, braddress)
• employee( staffNo, forename, surname, empbranch, supervisor)
• account( accountno, type, balance, inBranch ) - type is "deposit", "current", …
• owner( accno, custID)
• customer( ID, forename, surname, address, occupation)
1. Construct relational algebra expressions which describe the following information
a. The types of accounts for which there are no instances with a negative balance
b. The types of accounts for which there is at least one instance with a negative balance
|
For the (A), this is what I've came up with and I'll try my best to get the symbols going:
beta -> σ
balance<0(account)
alpha -> π
typebeta
π
type(account-alpha)
It's my understanding that I select any account with negative balance and then select only the types which, then I remove any of those types within the account table that is contained within the alpha relations. Is that correct?
(B)
beta -> σ
balance<0account
π
type(beta)
Again, it's my understanding that what I did was select any account that has negative balance and select the types, is that correct?
I think I'm basing those assumptions that the projection operations are removing any duplicates data