KnowledgeBoat Logo
|

Informatics Practices

In a Database School there are two tables Member and Division as shown below.

Table : Member

EmpIdNamePayDivno
1001Shankhya3400010
1003Ridhima3200050
1002Sunish4500020

Table : Division

DivnoDivnameLocation
10MediaTF02
20DanceFF02
30ProductionSF01

(i) Identify the foreign key in the table Member.

(ii) What output, you will get, when an equi-join query is executed to get the NAME from Member Table and corresponding from Division table ?

SQL Joins & Grouping

1 Like

Answer

(i) The foreign key in the "Member" table is the "Divno" column, which references the "Divno" column in the "Division" table.

(ii)

SELECT m.Name, d.Divname 
FROM Member m JOIN Division d ON m.Divno = d.Divno;
Output
+----------+---------+
| Name     | Divname |
+----------+---------+
| SHANKHYA | Media   |
| SUNISH   | Dance   |
+----------+---------+

Answered By

2 Likes


Related Questions