Calculate the number of tuples, PL-SQL Programming

Assignment Help:

Question:

(a) The objective of query optimization is to choose the most efficient strategy for implementing a given relational query, thereby improving the system performance. One of the stages of query optimization is to convert the internal form into equivalent and more efficient canonical form, using well-defined transformation rules. Two rules of the transformation rules is given below:

Rule 1 - Transform a sequence of restrictions against a given relation into a single (ANDed) restriction.

Rule 2 - Transform a restriction of a projection into a projection of a restriction.

(i) Explain what is meant by each of the above rules.

(ii) Using the relational schema given in Appendix, provide example of each of the above rules.

(b) Refer to the relational schema given in Appendix.

Assuming that:

 The Employee relation contains 1000 records among which 300 employee are assigned to departments located in the United States.
- The Department relation contains 30 records among which 20 departments are located in United States
- The Location relation contains 20 records among which 5 are situated in the United States.

(i) Express the following query in SQL:

"find the employee Last names and the department names who are working in United States (Location.country_id = US)

(ii) Choose two possible methods to evaluate the query, and use the relational algebra to formulate clearly all the steps required in the evaluation. For each method, calculate the number of tuples for all the intermediate relations (namely, size of the intermediate relations) required for each step.


Related Discussions:- Calculate the number of tuples

Authorize and fetch data from instagram, Authorize and fetch data from Inst...

Authorize and fetch data from Instagram Project Description: Incorporate Instagram feed on mobile site platform: c#, ms sql, jquerymobile, jquery Web admin Author

Using %rowtype-declarations in sql, Using %ROWTYPE The %ROWTYPE attribut...

Using %ROWTYPE The %ROWTYPE attribute gives a record type which represents a row in a table (or view). The record can store the whole row of data selected from the table or fetc

Using commit, Using COMMIT The COMMIT statements end the present trans...

Using COMMIT The COMMIT statements end the present transaction and make permanent any changes made during that transaction. Till you commit the changes, other users cannot acc

Using aggregation on nested tables - sql, Using Aggregation on Nested Table...

Using Aggregation on Nested Tables Example is the most direct translation of its counterpart in the theory book that can be obtained in SQL but it is so over-elaborate that no

Cursor attributes in dynamic sql - pl sql, Using Cursor Attributes: Ev...

Using Cursor Attributes: Every cursor has 4 attributes: %NOTFOUND, %FOUND, %ISOPEN, and %ROWCOUNT. If appended to the cursor name, they return the helpful information about

Calculate the number of tuples, Question: (a) The objective of query opti...

Question: (a) The objective of query optimization is to choose the most efficient strategy for implementing a given relational query, thereby improving the system performance. On

Keys in sql, Keys in SQL SQL support for keys in the following respect...

Keys in SQL SQL support for keys in the following respects: SQL does not require at least one key for every base table. If no key is explicitly declared, then KEY {ALL B

Keyword and parameter description - if statement, Keyword and Parameter Des...

Keyword and Parameter Description: boolean_expression: This is an expression which results the Boolean value TRUE, FALSE, & NULL. It is related with a series of statement

Database values-assignments in pl/sql, Database Values You can use the S...

Database Values You can use the SELECT statement to have the Oracle assign values to a variable. For Each and every item in the select list, there must be a matching, type-compa

Substitution and instantiation - sql, Substitution and Instantiation - SQL ...

Substitution and Instantiation - SQL It shows how NULL might appear in substitution for a parameter of a predicate and how it might thus participate in instantiation of that p

Write Your Message!

Captcha
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