Question
For these exercises, we use the Employees Database presented in the other picture. Answer each question with a single SQL statement. Your query must work
For these exercises, we use the Employees Database presented in the other picture. Answer each question with a single SQL statement. Your query must work for any set of data in the Employees Database, not just the set of data we provide.
1. Find the names of all people who work in the Consulting department and who spend more than 20% of their time on the project with ID ADT4MFIA. Solve three ways:
A) using only WHERE-based join (i.e., no INNER/OUTER/CROSS JOIN),
B) using JOINON
C) using NATURAL JOIN whenever possible and JOIN ON otherwise.
2. Find the total percentage of time assigned to employee Abe Advice. Solve it two ways:
A) using only WHERE-based join (i.e., no INNER/OUTER/CROSS JOIN) and 2) using some form of JOIN.
3. Find the descriptions of all projects that require more than 70% of an employees time. Solve it two ways:
A) using only WHERE-based join (i.e., no INNER/OUTER/CROSS JOIN)
B) using some form of JOIN.
4. For each employee ID, find the last name of all employees making more money than that employee. Solve it two ways:
A) using only WHERE-based join (i.e., no INNER/OUTER/CROSS JOIN)
B) using some form of JOIN.
5. Rank the projects by revenue. Solve it two ways:
A) using only WHERE-based join (i.e., no INNER/OUTER/CROSS JOIN)
B) using some form of JOIN.
Tools Donahoo-SQL P. x 24 Chapter 1: Databasics departments code projects projectid deptcodexname description startdate enddate managerid subdeptof T workson projectid revenue employeeidH assignedtime employees employeed firstname astname deplcode X salary Figure 1.5: Schema for the Employees Database
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started