Informatics Practices

Write a SQL query to display all the divnos in Member table but not in the Division table.

Table : Member

EmpIdNamePayDivno
1001Shankhya3400010
1003Ridhima3200050
1002Sunish4500020

Table : Division

DivnoDivnameLocation
10MediaTF02
20DanceFF02
30ProductionSF01

SQL Joins & Grouping

3 Likes

Answer

SELECT m.Divno 
FROM Member m 
LEFT JOIN Division d ON m.Divno = d.Divno 
WHERE d.Divno IS NULL;
Output
+-------+
| Divno |
+-------+
|    50 |
+-------+

Answered By

1 Like


Related Questions