Division Operation

来源:互联网 发布:网站关键词优化教程 编辑:程序博客网 时间:2024/04/26 10:13

Suited to queries that include the phrase “for all”.
Let r and s be relations on schemas R and S respectively where
R = (A1, …, Am, B1, …, Bn)
S = (B1, …, Bn)
The result of  r  s is a relation on schema
R – S = (A1, …, Am)

r  s = { t  |  t   R-S(r)   u  s ( tu  r ) }

Property
Let q =r   s
Then q is the largest relation satisfying q x s  r
Definition in terms of the basic algebra operation Let r(R) and s(S) be relations, and let S   R

 r  s = R-S (r) –R-S ( (R-S (r) x s) – R-S,S(r))
 To see why
R-S,S(r) simply reorders attributes of r
R-S(R-S (r) x s) – R-S,S(r)) gives those tuples t in R-S (r) such that for some tuple u  s, tu  r.

 

 

原创粉丝点击