关系代数表达式π1,5,6(σ1>5(RXS))怎么看懂?

来源:百度知道 编辑:UC知道 时间:2024/06/01 02:28:51
R和S自然连接后是什么?

R表 A B C S表 A B C
1 2 4 5 3 3
3 4 5 4 6 1
4 5 9 9 8 3
5 6 6 6 9 1

数字说的是列号。
RXS 先用表R和S做笛卡尔积(知道怎么做吧,这个就不说了)
σ1>5 然后从RXS结果中选第1列大于第5列的元组
π1,5,6 最后取这些元组的第1,5,6列组成新表,即是最后结果

try to cpmare each tuple in R with S to find out wheather they equal in same attributes. If they equal, join them without repeated attribute (in this case, A B C should be the attribute of result.) and add them in the new table. The case you gave has no same tuple in R and S, so result is an empty table.
I think that you can find this in a db textbook, it's alway better to learn yourself than to ask.
Sorry there is no Chinese input here.

RXS:R和S是两张表,RXS是它们的笛卡尔积,我们假设结果为关系T
σ1>5(T):选择T中第一列大于第五列的元组,我们假设为关系M
π1,5,6(M):投影M中第一列、第五列和第六列,组成新的关系,也就是最终结构