Reference no: EM13500789
Consider the following SQL query over tables R(A), S(A), and T (A). Note that "Select Distinct" in SQL represents a duplicate-eliminating projection.
Select Distinct R.A
From R, S, T
Where R.A = S.A and R.A = T.A
If we have a table with R(A, B) tuples {{1, a}, {1, b}, {2, c}, {3, d}, {4, e}, {4, f }}, then a duplicate-preserving projection on R.A will return {1, 1, 2, 3, 4, 4}, while a duplicate-eliminating projection on R.A will return {1, 2, 3, 4}.
Figures 1(a)-(e) show five logical plans. The logical operator π in Figure 1 represents a duplicate-eliminating projection. For example, πR.A represents a duplicate-eliminating projection of attribute R.A. On the other hand, the logical operator τ represents a duplicate-preserving projection. The logical operator ?? represents a natural join. Assume that, in the general case, R, S, and T can contain duplicate tuples.
1. Is the logical plan in Figure 1(a) equivalent to the logical plan in Figure 1(b)? (Equivalent means that they produce the same query result.) If not, what is the minimal set of properties on the tables such that these plans are equivalent?
2. Is the logical plan in Figure 1(a) equivalent to the logical plan in Figure 1(c)? If not, what is the minimal set of properties on the tables such that these plans are equivalent?
3. Is the logical plan in Figure 1(a) equivalent to the logical plan in Figure 1(d)? If not, what is the minimal set of properties on the tables such that these plans are equivalent?
4. Is the logical plan in Figure 1(a) equivalent to the logical plan in Figure 1(e)? If not, what is the minimal set of properties on the tables such that these plans are equivalent?
1
τR.A
π R.A π R.A
T(A)
T(A) R(A) π R.A S(A)
R(A) S(A) T(A) S(A)
R(A)
(a) (b) (c)
τR.A τR.A
π R.A π R.A π
T(A) T.A
T(A)
R(A) S(A) R(A) S(A)
(d) (e)
Figure 1: Logical plans
Compute the total asset value
: For this project assume that an organization has five total servers. One server has a TCO of $25,000, two servers have a TCO of $37,000 and the remaining two servers have a TCO of $42,000. The servers are not used by internal employees but are ..
|
Would you advise switching to this alternative plan
: All of the costs ofgoods sold are variable, 50 pereent ofthe marketing and distribution costs are variable, and 40 percent ofthe administration costs are variable.
|
Explain why the yield on a convertible bond is lower than
: General Electric has just issued a callable 10-year, 6% coupon bond with annual coupon payments. The bond can be called at par in one year or anytime thereafter on a coupon payment date. It has a price of $102. What is the bond’s yield to maturity an..
|
Explain the average speed of the sprinter in kilometers
: A sprinter set a high school record in track and field, running 200.0 m in 21.6 s. What is the average speed of the sprinter in kilometers per hour
|
A duplicate eliminating projection
: Consider the following SQL query over tables R(A), S(A), and T (A). Note that "Select Distinct" in SQL represents a duplicate-eliminating projection.
|
Explain the mass concentration of oxygen in the mixture
: Suppose you have made 1L worth of a mixture of methanol and water, by mixing 3 parts of methanol and 2 parts of water by mass. Assume for simplicity that the volume of the mixture is exactly equal to the sum of the volumes of the ingredients (whic..
|
Attributes and behaviors
: Write a Class called Course containing the following attributes and behaviors
|
Determine the eost of goods available for sale
: Determine the ending inventory and the cost of goods sold under each of the cost flow methods of FIFO, LIFO, and weighted average cost.
|
Describe the kinds of securities the u.s. government uses
: On January 15, 2020, the U.S. Treasury issued a 10-year inflation-indexed note with a coupon of 6%. On the date of issue, the CPI was 400. By January 15, 2030, the CPI had decreased to 300. What principal and coupon payment was made on January 15, 20..
|