【正文】
1. πr(R S)2. R δ(πr∩s(S)) where δ is the duplicateelimination operator in Section pg. 2133. R – (R – πr(R S))Exercise Defining r as the schema of R1. R πr(R S)Exercise πA1,A2…An(R S)Exercise σspeed AND price 500(PC) = 248。Model 1011 violates this constraint.Exercise σscreen AND hd 100 AND price ≥ 1000(Laptop) = 248。Model 2004 violates the constraint.Exercise πmaker(σtype = laptop(Product)) ∩ πmaker(σtype = pc(Product)) = 248。Manufacturers A,B,E violate the constraint.Exercise This plex expression is best seen as a sequence of steps in which we define temporary relations R1 through R4 that stand for nodes of expression trees. Here is the sequence: R1(maker, model, speed) := πmaker,model,speed(Product PC) R2(maker, speed) := πmaker,speed(Product Laptop) R3(model) := πmodel(R1 = AND ≤ R2) R4(model) := πmodel(PC)The constraint is R4 ? R3Manufacturers B,C,D violate the constraint.Exercise πmodel( AND ≤ (PC Laptop)) = 248。Models 2002,2006,2008 violate the constraint.Exercise πclass(σbore 16(Classes)) = 248。The Yamato class violates the constraint.Exercise πclass(σnumGuns 9 AND bore 14(Classes)) = 248。No violations to the constraint.Exercise This plex expression is best seen as a sequence of steps in which we define temporary relations R1 through R5 that stand for nodes of expression trees. Here is the sequence: R1(class,name) := πclass,name(Classes Ships) R2(class2,name2) := ρR2(class2,name2)(R1) R3(class3,name3) := ρR3(class3,name3)(R1) R4(class,name,class2,name2) := R1 (class = class2 AND name name2) R2 R5(class,name,class2,name2,class3,name3) := R4 (class=class3 AND name name3 AND name2 name3) R3The constraint is R5 = 248。The Kongo, Iowa and Revenge classes violate the constraint.Exercise πcountry(σtype = bb(Classes)) ∩ πcountry(σtype = bc(Classes)) = 248。Japan and Gt. Britain violate the constraint.Exercise This plex expression is best seen as a sequence of steps in which we define temporary relations R1 through R5 that stand for nodes of expression trees. Here is the sequence: R1(ship,battle,result,class) := πship,battle,result,class(Outes (ship = name) Ships) R2(ship,battle,result,numGuns) := πship,battle,result,numGuns(R1 Classes) R3(ship,battle) := πship,battle(σnumGuns 9 AND result = sunk (R2)) R4(ship2,battle2) := ρR4(ship2,battle2)(πship,battle(σnumGuns 9(R2))) R5(ship2) := πship2(R3 (battle = battle2) R4)The constraint is R5 = 248。No violations to the constraint. Since there are some ships in the Outes table that are not in the Ships table, we are unable to determine the number of guns on that ship.Exercise Defining r as the schema A1,A2,…,An and s as the schema B1,B2,…,Bn:πr(R) πs(S) = 248。 where is the antisemijoinExercise The form of a constraint as E1 = E2 can be expressed as the other two constraints. Using the “equating an expression to the empty set” method, we can simply say:E1 – E2 = 248。As a containment, we can simply say:E1 ? E2 AND E2 ? E1Thus, the form E1 = E2 of a constraint cannot express more than the two other forms discussed in this section.