KnowledgeBoat Logo
|

Informatics Practices

Write a SQL query to display all the distinct divnos from both the tables.

Table : Member

EmpIdNamePayDivno
1001Shankhya3400010
1003Ridhima3200050
1002Sunish4500020

Table : Division

DivnoDivnameLocation
10MediaTF02
20DanceFF02
30ProductionSF01

SQL Joins & Grouping

2 Likes

Answer

SELECT DISTINCT DIVNO FROM MEMBER 
UNION 
SELECT DISTINCT DIVNO FROM DIVISION;
Output
+-------+
| DIVNO |
+-------+
|    10 |
|    20 |
|    50 |
|    30 |
+-------+

Answered By

3 Likes


Related Questions