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

  Create a database model

Create a database model and Submit the table creation statements for the Database Model.

  Write pl-sql procedures and functions

Write PL/SQL procedures and functions to populate and query that database

  Sql questions

Write a query to display using the employees table the EMPLOYEE_ID, FIRST_NAME, LAST_NAME and HIRE_DATE of every employee who was hired after to 1 January, 1995.

  Run the lab_03_01.sql script

Run the lab_03_01.sql script in the attached file to create the SAL_HISTORY table. Display the structure of the SAL_HISTORY table.

  Write sql queries

Write a query to display the last name, department number, and salary of any employee whose department number and salary both match the department number and salary of any employee who earns a commission.

  Explaining sql insert statement to insert new row in cds

Write down a SQL insert statement to insert new row in "CDS" table.

  Write down name of actors in ascending order

Write down actors (or actress, your choice, but not both) who have won at least two (2) Academy Awards for best actor/actress. Provide the actor name, movie title & year. Order the result by actor name."

  What is an sql injection attack

What is an SQL injection attack? Explain how it works, and what precautions must be taken to prevent SQL injection attacks.What are two advantages of encrypting data stored in the database?

  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

  Query that uses cube operator to return lineitemsum

Write summary query which uses CUBE operator to return LineItemSum (which is the sum of InvoiceLineItemAmount) group by Account(an alias for AccountDesciption).

  Query to show customers were missing for existing orders

As DBA, your manager called a meeting and asked why there are so many orders for customers that don't exist in the customer table. Write query which would shows which customers were missing for existing orders. Use a join or a subquery.

  Sql query into a relational algebra statement

Turn this SQL query into a relational algebra statement? SELECT Request.reqfor, Ordering.invamt, Ordering.invnbr, Ordering.invdat

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