I have 4 tables Position, Employee, Training and Trmatrix.
Table Position
PositionId PosName TrainingId 1 developer 1,2,3 2 Designer 4,5 3 BDA 2,3,6
Table Employee
Employeeid Ename Posid Courseid 1 Alex 1 4 2 Shaun 2 1,2,3 3 Hales 3
Table Training
Trainingid Trainingname 1 JAVA 2 Dot Net 3 PHP 4 Photoshop 5 JQUERY 6 Client Handling
TrMatrix
TrmatId TrID empID 1 1 1 2 2 1 3 3 1 4 4 1 5 4 2 6 5 2 7 1 2 8 2 2 9 2 3 10 3 3
foreign Key relation trmatrix trId corresponds to the trainingID of the trainingtable. Employee posid corresponds to the PositionId of the Positiontable. Employee courseId corresponds to the trainingId of the trianingtable.
BY basic Aim is to get that course/trainingname which is no present in the EMployee.Courseid column in correspondance to the trmatrix table, which defines that I have to get the all entries from the trmatrix table for which there is no entry in the employee table Courseid column. Suppose in case of Alex I have to fetch all the data from the trmatrix table except for course 4 since it is present in the courseid column of the Employee table, so it would return course no 1,2,3 not the no 4. I am Newbie to the SQL so please help me out with this problem.
Thanks in advance