Database employee (employee_name, street, city) works (employee_name, company na
ID: 3793286 • Letter: D
Question
Database
employee (employee_name, street, city)
works (employee_name, company name, salary)
company (company_name, city)
manages (employee_name, manager_name)
1. Find the number of employees of each company. Rename the second attribute in the output as number_employees. Assume that each company has at least one employee.
2. For companies that have at least three employees, find company name and number of empolyees. Rename the second attribute in the output as number_employees. Remark: this question is similar to the previous one but the output lists only companies with at least three employees.
Explanation / Answer
employee (employee_name, street, city)
works (employee_name, company name, salary)
company (company_name, city)
manages (employee_name, manager_name)
1.select employee.employee-name
from employee
where enployee.employee-name=employee number
rename table employee table to number_employee
2.select employee.employee-name
select work.employee-name
where employee >=3
rename table number_employee.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.