Relational algebra, I have a table which only has pid in a loan schema. I want to know how to select and display pid100 and pid101. (Schema called LOAN) using correct syntax, without Union.
Asked
Active
Viewed 1,454 times
-1
-
There's no single relational algebra so you need to give a reference to yours. Also your question is not clear. Read it. You don't even say what tables you have & what a row in each tells you. Please use standard grammar & punctuation. Please read [mcve]--since relational algebra is a programming language. – philipxy Oct 10 '18 at 19:32
-
CKs, PKs, FKs, cardinalities & other constraints are not needed to query. Table meanings ("what a row in each tells you") are necessary & sufficient. [Re relational querying.](https://stackoverflow.com/a/24425914/3404097) – philipxy Oct 11 '18 at 05:41
1 Answers
0
I found that I needed to use 'or', as I was selecting pid100 'Or' pid101 to display both id's.
σpid = "pid100" 'Or' "pid101" σpid = "pid100" ∨ "pid101"
Credit to @AntC

j.bow
- 3
- 3
-
You mean "∧" (logical and) not "^" (carat). You are more likely to be clear using "and" than "^". (You can google 'unicode' with a symbol name or description of its use.) – philipxy Oct 10 '18 at 19:38
-
'And'? I'd expect you'd need 'Or': sigma (pid = "pid100' OR pid = "Pid101")(Loan). You could also do it with a Union between two sigma terms. I won't try to guess which symbols you'd need -- it depends which dialect of the algebra you're using. – AntC Oct 15 '18 at 07:25