For these exercises, we use the Employees Database presented at the end of Chapt
ID: 3702525 • Letter: F
Question
For these exercises, we use the Employees Database presented at the end of Chapter 1. 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.
3. Find the total percentage of time assigned to employee Abe Advice. Solve it two ways:
1) using only WHERE-based join (i.e., no INNER/OUTER/CROSS JOIN) and 2) using
some form of JOIN.
Explanation / Answer
If you have any doubts, please give me comment...
--TYPE 1)
SELECT SUM(assignedtime) AS TotalTime
FROM workson w, employees e
WHERE w.employeeid = e.employeeid AND e.firstname='Abe' AND e.lastname='Advice';
--TYPE 2)
SELECT SUM(assignedtime) AS TotalTime
FROM workson NATURAL JOIN employees
WHERE firstname='Abe' AND lastname='Advice';