I'm a student this is part of a homework assignment. Thanks for any advice.
I have 2 tables.
Employee has a column last_name,
Job_title has a exempt_non_exempt column it's data type is bit. 0 for hourly 1 for salary
The primary key and foreign key is job_title for both tables.
I need to find out How many employees are salaried and how many are hourly? I can only use one statement. So I need to COUNT and JOIN
I have 10 employees and 8 are hourly and 2 are salaried.
*
This code shows the count as 7
Select Employee.Last_name, Job_title.Exempt_Non_Exempt_Status,
COUNT (Exempt_Non_Exempt_Status)
from Employee, Job_title
where Exempt_Non_Exempt_Status=0
group by Employee.Last_name, Job_title.Exempt_Non_Exempt_Status
I started with this and can change the status to =o or =1 but that requires 2 Select statements
SELECT LAST_NAME FROM Employee
JOIN JOB_TITLE
ON EMPLOYEE.JOB_TITLE=JOB_TITLE.JOB_TITLE
WHERE Exempt_Non_Exempt_Status
=0
ORDER BY Last_name