Find ID and name of each employee who lives in the same city as the location of the company for which the employee works. Find ID and name of each employee who lives in the same city and on the same street as does her or his manager. Find ID and name of each employee who earns more than the average salary of all employees of her or his company. Find the company that has the smallest payroll.
Added by Eugenia E.
Step 1
Let's break down each question into step-by-step solutions: Show more…
Show all steps
Your feedback will help us improve your experience
Akash M and 100 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Consider the following database: Employee (person name, street, city), Works (person name, street, city), manages (person name, manager name). Using relational algebra, answer the following queries: 1. Find the names of all employees who earn more than every employee of the company "Company A". 2. Find the names of all employees who live in the same city as their managers.
Akash M.
Find the results in SQL for these queries: Find the first name and last name of the employees who are supervised by "Franklin Wong"? Find the last and first name of the female employees who have a dependent with the same first name as themselves? For each department, find out the department manager's last name, his start date, and the names of his dependents (if any)? For each employee, find out the employee's last and first name, the department name in which he works, the project name he works in, and the number of hours he works in those projects.
Madhur L.
Consider the following relational database: employee (person_name, street, city) works (person_name, company_name, salary) company (company_name, city) manages(person_name, manager_name) Write the following queries in relational algebra. [20 points] Use natural join to find names of employees who work for a company located in the city "Springfield". Schema of the output should be (person_name, company_name). [20 points] Find number of employees managed by each manager. Rename the count as numManaged. I.e., schema of the output should be (manager_name, numManaged). Use the assignment operator to store the result in a relation with the name r. [20 points] Use the relation r that you found in the previous question to find names of managers who manage at least 10 employees. [20 points] Find person_name of the employee(s) who earns the highest salary. Make sure to use an aggregate function to help you answer this question. [20 points] Assume that a company can be located in several cities (remark: this will imply that company_name is no longer primary key for company.) Find company_name for companies that are located in every city where the company "Fedco" is located.
Aarya B.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
Watch the video solution with this free unlock.
EMAIL
PASSWORD