Identify a relational algebra tree

Assignment Help Database Management System
Reference no: EM13336573

Consider the following relational schema and SQL query. The schema captures information about employees, departments, and company finances (organized on a per department basis).

Emp (eid:integer, did:integer, sal:integer, hobby:char(20))

Dept (did:integer, dname:char(20), floor:integer, phone:char(10))

Finance (did:integer, budget:real, sales:real, expenses:real)4

Consider the following query:

SELECT D.dname, F.budget

FROM Emp E, Dept D, Finance F

WHERE E.did = D.did AND D.did = F.did AND D.floor = 1

AND E.sal ≥ 59000 AND E.hobby = ‘yodeling'

1. Identify a relational algebra tree (or a relational algebra expression if you prefer) that reflects the order of operations a decent query optimizer would choose.

2. List the join orders (i.e., orders in which pairs of relations can be joined to compute the query result) that a relational query optimizer will consider. (Assume that the optimizer follows the heuristic of never considering plans that require the computation of crossproducts.) Explain briefly how you arrived at your list.

3. Suppose that the following additional information is available: Unclustered B+ tree indexes exist on Emp.did, Emp.sal, Dept.floor,Dept.did, and Finance.did. The system's statistics indicate that employee salaries range from 10,000 to 60,000, employees enjoy 200 different hobbies, and the company owns two floors in the building. There are a total of 50,000 employees and 5,000 departments (each with corresponding financial information) in the database. The DBMS used by the company has just one join method available, index nested loops.

a. For each of the query's base relations (Emp, Dept, and Finance) estimate the number of tuples that would be initially selected from that relation if all of the nonjoin predicates on that relation were applied to it before any join processing begins.

b. Given your answer to the preceding question, which of the join orders considered by the optimizer has the lowest estimated cost?

 

Reference no: EM13336573

Questions Cloud

Modify the syntax of a programming language : Sometimes it is necessary to modify the syntax of a programming language. This is done by changing the CFG that the language uses. What changes would have to be made to ac's CFG (Figure) to implement the following changes?
Briefly explain the aries recovery algorithm : Briefly explain the ARIES recovery algorithm, including the main phases, main principles and key ideas behind the algorithm such as WAL protocol and checkpointing etc.
How many revolutions does the drum make during the fall : You are the technical consultant for an action-adventure film in which a stunt calls for the hero to drop off a 23.7-m tall building and land on the ground safely at a final vertical speed of 3.85 m/s. How many revolutions does the drum make during..
Compiler design problem : This is done by changing the CFG that the language uses and what changes would have to be made to ac's CFG
Identify a relational algebra tree : Identify a relational algebra tree (or a relational algebra expression if you prefer) that reflects the order of operations a decent query optimizer would choose.
Compute the magnitude of the magnetic flux through the loop : A solenoid with 1200 turns per meter has a diameter of 9.00 cm. A current I = 2.57 A flows in the clockwise direction, Find the magnitude of the magnetic flux through the loop
What is the cost of joining r and s using a sort-merge join : What is the cost of joining R and S using a page-oriented simple nested loops join? What is the minimum number of buffer pages required for this cost to remain unchanged?
What is the total i/o cost for sorting this file : How many sorted subfiles will there be after the initial pass of the sort, and how long will each subfile be?
What is the carts final velocity : A 100 N force has a horizontal component of 60 N and a vertical component of 80 N. What is the cart's final velocity

Reviews

Write a Review

Database Management System Questions & Answers

  Provide an entity relationship model

Provide an Entity Relationship Model (ERM) that will describe the data structure that will store all data elements.Note:The graphically depicted solution is not included in the required page length.

  Explaining controls for database to execute transaction

Controls which need a database to either execute transaction completely or not at all.

  Data analysis and definition

What is the business implications that can be drawn from the process of building and comparing these models, and has this practice helped resolve the business issue? Why or why not?

  Create the relational model

Create the relational model corresponding to the described application. Basically, list the CREATE TABLE statements with the attribute names, and appropriate data types.

  Convert data model to a set of virtual windows

You are to design a prototype for a hospital management system. Design a data model for this system, Convert the data model to a set of virtual windows.

  Write name of employee on every project located in houston

Write the name(s) of employee(s) who works(work) on every project located in Houston. Write the name(s) of employee(s) who only works(work) on every project located in 'Houston.'

  Write sql statements to calculate average salary

Write SQL statements that do the following: Calculate the average salary for all employees. Calculate the maximum salaries for exempt and non-exempt employees.

  Finding the most expensive product item in the shopping cart

Your program needs to be able to find the cheapest product item in the shopping cart. For it you may adopt the same strategy described in Subtask 2.2.

  Types of relationships in a design model of a database

There are many kinds of relationships in a design model of a database. Why is it important to classify each of these types in an ERD Model?

  Referential integrity constraint prevent from data inserting

What actions does a referential integrity constraint prevent from occurring when data is inserted in a table that contains this constraint?

  Examine use of database applications in organization

Prepare a memorandum examining use of databases in organization. Write database applications are used: Microsoft Access, DB2, Oracle, etc.

  Problem on concept learning

Write an algorithm called \Find-G" to nd a maximally-general consistent hypothesis. You can assume the data will be noise-free and that the target concept is in the hypothesis space.

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