A duplicate eliminating projection

Assignment Help PL-SQL Programming
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

Reference no: EM13500789

Questions Cloud

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..

Reviews

Write a Review

PL-SQL Programming Questions & Answers

  Write queries in sql and relational algebra

Write given queries in SQL and relational algebra: Determine cities from which one can fly to Toronto with one change of planes, and using same type of the aircraft for both legs of trip.

  Create the needed tables in the sql server environment

Create and submit a screenshot of your database diagram based on the tables, and generate the data definition language (DDL) for each table.

  Sql give syntax of how to create table in sql and also give

give syntax of how to create table in sql and also give small demo to how to create table in sql.

  If the value for the listprice column is a negative number

If the value for the ListPrice column is a negative number, the stored procedure should raise an error that indicates that this column doesn't accept negative numbers. Similarly, the procedure should raise an error if the value for the DiscountPer..

  Display all the lastnames from the customers

Display all the LastNames from the Customers table and any associated OrdersIDs from the Orders Table. Show the LastName even if they do not have any associated orders. Order the results by LastName in ascending order.

  Write a pl/sql block and declare a variable v_sal

Write a PL/SQL block and declare a variable  v_sal  of the type NUMBER. Include the following statement in the Execution section:

  Commands that you would use to create a 7x7 matrix

Show the unix/linux commands that you would use to create a 7x7 matrix of alternating entries of 1's and 0's. It should look like this

  Execute queries to confirm that the basket order status

Execute queries to confirm that the basket order status and product stock levels have been appropriately modified by the trigger.

  How does the order of joins in an sql statement

How does the order of joins in an SQL statement affect the performance of the join and what can the DBA do to determine the preferred order of joins for an SQL statement that includes the join of at least three tables?

  Determine resonant frequency in series rlc resonant circuit

Given the series RLC resonant circuit in the figure, operating at variable frequency, determine: The resonant frequency ω o ,  The circuit’s quality factor Q , The cut-off frequencies, f 1  & f 2  and the bandwidth BW

  How to understand sql ddl and dml

Task one will provide a relational database implementation of the sample solution from the first assignment. This should be done using CASE software (the choice will be up to you).

  Develop and demonstrate sql skills

Write a script that provides all of the information in, and duplicates the formatting of, Oracle's SQL*Plus describe command. Additionally, the output should add the comments on the rows.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd