I have three tables.
1. Jobs: jobid, jobname, payrate
2. JobAssign: jobid, empID
3. Employees: EmpID, EmpName
The Jobs table contains the details of the jobs. The employee table contains the details of the employees.
The JobAssign tables puts the two together. In some cases and employee can have two jobs. So if I searched JobAssign for a specific ID, I should get all the JobIDs for which that employee is assigned:
select * from Jobs inner join JobAssign on Jobs.Jobid = JobAssign.jobid where JobAssign.EmpId = 1
I'm trying to set it up so I can find all the jobs that an employee has NOT been assigned too.
Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.