Represent a subquery in relational algebra

前端 未结 3 649
滥情空心
滥情空心 2020-12-31 20:44

How do I represent a subquery in relation algebra? Do I put the new select under the previous select condition?

SELECT number
FROM collection
WHERE number =          


        
3条回答
  •  执念已碎
    2020-12-31 21:25

    You would just rewrite that as a join.

    I'm not sure how widely used the syntax I learned for Relational Algebra is so in words.

    1. Take a projection of anotherNumber from anotherStack
    2. Rename anotherNumber from the result of step 1 as number
    3. Natural Join the result of step 2 onto collection
    4. Take a final projection of number from the result of step 3

提交回复
热议问题