Write a sequence of operations to answer the query. Also, provide an answer to t
ID: 3590750 • Letter: W
Question
Write a sequence of operations to answer the query. Also, provide an answer to the query. Use Tables 1-4 Find the names of all employees. (Do not include any managers.) Table 1 Express the relation given by Table as a set of n-tuples. ID Name Manager 089 Suzuki Zamora 5620 KaminskiJones 9354 JonesYu 9551Ryan Washington 3600 Beaulieu Yu 0285 SchmidtJones 6684 ManacottiJones Table 2 Express the relation given by Table as a set of n-tuples. Dept Manager 23 Jones 04 Yu 96 Zamora 66 Washington Table 3 Express the relation given by Table as a set of n-tuples. Dept Part No Amount 4 335B2 220 3 2A 14Explanation / Answer
As we need to find name of all employee names except managers, Only "Table 1" is enough.
Steps to find out the same:
-- The Following query will return all the employee names
SELECT t1.Name FROM Table1 t1;
-- This query will return all the mangers name
SELECT t2.Manager FROM Table1 t2
-- Now Finally we need to remove mangers from first resultset. so the final query will be as below. for the same we need to use where and Not In clause
SELECT t1.Name as EmployeeName
FROM Table1 t1
WHERE t1.Name NOT IN(
SELECT t2.Manager
FROM Table1 t2
);
Result:
EmployeeName
-------------------------------
Suzuki
Kaminski
Ryan
Beaulieu
Schmidt
Manacotti
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.