Whose age is equal to their managers age first a nested

Assignment Help Database Management System
Reference no: EM13509225

Consider two ways to compute the names of employees who earn more than $100,000 and whose age is equal to their manager’s age. First, a nested query:

SELECT E1.ename FROM Emp E1

WHERE E1.sal > 100 AND E1.age = ( SELECT E2.age

FROM Emp E2, Dept D2 WHERE E1.dname = D2.dname

AND D2.mgr = E2.ename )

Second, a query that uses a view de?nition:

SELECT E1.ename

FROM Emp E1, MgrAge A

WHERE E1.dname = A.dname AND E1.sal > 100 AND E1.age = A.age

CREATE VIEW MgrAge (dname, age) AS SELECT D.dname, E.age

FROM Emp E, Dept D WHERE D.mgr = E.ename

1. Describe a situation in which the ?rst query is likely to outperform the second query.

2. Describe a situation in which the second query is likely to outperform the ?rst query.

3. Can you construct an equivalent query that is likely to beat both these queries when every employee who earns more than $100,000 is either 35 or 40 years old? Explain brie?y.

Reference no: EM13509225

Questions Cloud

Find the speed of the watermelon : Suppose a 1.5 kg watermelon is hung from a string. A bolt with a mass of 30 grams is shot into the watermelon. Find the speed of the watermelon immediately after the arrow exits
Determine vertical height does the block reach : A 1.2 kg wood block is launched up a wooden ramp that is inclined at a 24° angle. The block's initial speed is 13 m/s. What vertical height does the block reach above its starting point
Computing depreciation under alternative methods : Plastic Works Corporation bought a machine at the beginning of the year at a cost of $12,000. The estimated useful life was five years, and the residual value was $2,000.
Impact of the proposed change : History and background of the project - identify the relevant GAAP and current standards involved. Discuss the proposed change (i.e., what will be different?) and the reasons for the change.
Whose age is equal to their managers age first a nested : Consider two ways to compute the names of employees who earn more than $100,000 and whose age is equal to their manager’s age. First, a nested query:
How far apart will the two packages land on the ground : A plane flying horizontally at a speed of 50.0 m/s and at an elevation of 160 m drops a package. How far apart will the two packages land on the ground
Prepare the statement of comprehensive income : Equity and Liabilities of the business. You need to indicate whether the element has increased or decreased and provide the relevant amount and account that would be affected- Prepare the statement of comprehensive income for Tracey's Toy Shop for ..
Describe a scenario in which discretionary access controls : Describe a scenario in which discretionary access controls are required to enforce a security policy that cannot be enforced using onlymandatory controls.
What is the average velocity of the plane : An airplane flying directly eastward at a constant rate travels 305 km in 2.0 h. What is the average velocity of the plane

Reviews

Write a Review

Database Management System Questions & Answers

  Create a data dictionary

Construct a query that will show the number of days that exist between the first invoice and last invoice, for each month, for each employee, using the DATEDIFF function. Be sure to provide the SQL script that will carry out this function.

  What is required to define a well-posed learning problem

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.

  Draw relationship diagram for arrays

Information Gathering Component is very important to a shopping cart system. You really want to develop a good algorithm for it. As a professional practice, you decided to first make a working plan in pseudocode before putting hands.

  Digitalx has been operating a chain of retail stores

digitalx has been operating a chain of retail stores selling cds dvds and games for a number of years. recently they

  Prepare a use case diagram for the case study

Case Study based on an Interview contained in a separate document (Please see the details in page 221 of your text book). Carefully read this case study. You are required to answer the following questions based on the Case Study.

  Relational database concepts and applications

Relational Database Concepts and Applications

  Explain what do business rules require to be effective

What are the advantages of having the DBMS between the end user's applications and the database. What are some reasons for studying file systems. IT 645 - Database Management Systems

  Explaining business activity in new is with a database

Assume you manage business activity which needs a new IS with a database. The development team is divided on which DBMS you must use. One faction wishes to use oracle,a second wants to use MtSQL, and a third wants to use SQL server.

  Probably its a quite simple problem to solve - but im not

i really would appreciate your help.probably its a quite simple problem to solve - but im not the one .. -i have two

  Design an expanded entity relationship model diagram

You are to design an Expanded Entity Relationship Model Diagram. An example of the Expanded Entity Relationship Model Diagram is seen in Figure 3.27 on page 89.

  Create database to keep information of movies

Create a database for Ray. He is interested in movies and wants to keep information on movies, actors, and directors in a database. The only user is Ray, and he needs to produce reports.

  Question 1 consider the relational schemapartpart-id name

question 1. consider the relational schemapartpart-id name costsubpartpart-id subpart-id counta tuple p1 p2 3 in the

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