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

  Provide an expression in relational algebra

Provide expression in relational algebra for each of the following queries: Give all the managers in database a 10 percent salary raise. Give all the other employees a 5 percent salary raise.

  Prepare table which is in first normal form

Prepare the example of table which is in first normal form but not in second normal form and example of a table which is in second normal form but not in third normal form.

  Assignment 62suppose your database system has failed

assignment 6.2suppose your database system has failed. describe the database recovery process and the use of

  Database management systems

An automotive service center or dealer wants to improve its services by using database management systems (DBMS) and data mining. What tables are needed in such a database and how could it help improve their services?

  Evaluate the selection of a database management

Identify and describe three criteria that should be used to evaluate the selection of a database management system. Describe how an organization should use each criterion to evaluate database management system selection.

  Write an sql query

Write an SQL query to get the author of the book "The Alchemist"

  How to make an xml file with markup tags

Create an XML file with markup tags and some sample data to represent a list of invoices. Include the XML tags for two invoices in the list. Also, assume the invoices are created from a database whose tables are shown in the following database re..

  Develop a domain model for the case study

The objective of the assignment is to apply and consolidate skills acquired in the requirement and analysis disciplines through analysis of a simple case study, and to express the results through the relevant UML diagrams.

  Draw a context diagram for the order system

Kitchen Gadgets sells a line of high-quality kitchen utensils and gadgets. When customers place orders on the company's Web site or through electronic data interchange (EDI).

  Part 1 true or false please explain why 1 sql structured

part 1 true or false please explain why. 1 sql structured query language is both ddl data definition language and dml

  1 construct a scenario leading to the worst-case

1. construct a scenario leading to the worst-case performance of the fifo buffer replacement policy.2. is it possible

  Develop a complete system

The assignment will be chosen by the individual student with my approval. An ideal assignment will be one which involves at least four entity sets, but not too many since there will be critical time pressure to complete the assignment.

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