QUESTION 10 Given the schema of Figure 3.20 on Page 108 of textbook. Which of th
ID: 3727703 • Letter: Q
Question
QUESTION 10 Given the schema of Figure 3.20 on Page 108 of textbook. Which of the following is the correct answer to the query: Find the name of employees who live in the same city that their company is located at. A select e.employee name from employee as e, works as w, company as c where w. company-name c. company-name and e. city = c. city select e.employee name from employee as e, company as c where e.city = c.city . .selecte.employee name from employee as e, works as w, company as c where e.employee name=w.employee name and w. company-name = c,company-name and e. city = c.city D. select employee name from employee as e, works as w, company as c where e.employee name=w.employee name and w.company-name c.company.name and e. city = c. cityExplanation / Answer
Your answer is correct. Let me explain all the options briefly.
a) This query won't give the expected results as there is no mapping between employee and work place.
b) This query is incorrect as this query doesn't map the employee and their company.
c) Correct query.
d) This query will give compilation error as multiple tables have the column 'employee_name' and we are not specifically mentioning the table name. This query would have been correct had we replaced select employee_name with select e.employee_name.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.