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

  Knowledge and data warehousing

Design a dimensional model for analysing Purchases for Adventure Works Cycles and implement it as cubes using SQL Server Analysis Services. The AdventureWorks OLTP sample database is the data source for you BI analysis.

  Design a database schema

Design a Database schema

  Entity-relationship diagram

Create an entity-relationship diagram and design accompanying table layout using sound relational modeling practices and concepts.

  Implement a database of courses and students for a school

Implement a database of courses and students for a school.

  Prepare the e-r diagram for the movie database

Energy in the home, personal energy use and home energy efficiency and Efficient use of ‘waste' heat and renewable heat sources

  Design relation schemas for the entire database

Design relation schemas for the entire database.

  Prepare the relational schema for database

Prepare the relational schema for database

  Data modeling and normalization

Data Modeling and Normalization

  Use cases perform a requirements analysis for the case study

Use Cases Perform a requirements analysis for the Case Study

  Knowledge and data warehousing

Knowledge and Data Warehousing

  Stack and queue data structure

Identify and explain the differences between a stack and a queue data structure

  Practice on topic of normalization

Practice on topic of Normalization

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