CBSE Class 12 Informatics Practices
Question 78 of 91
JOINS and SET Operations — Question 14
Back to all questions 14
Question In a Database School there are two tables Member and Division as shown below.
Table : Member
| EmpId | Name | Pay | Divno |
|---|---|---|---|
| 1001 | Shankhya | 34000 | 10 |
| 1003 | Ridhima | 32000 | 50 |
| 1002 | Sunish | 45000 | 20 |
Table : Division
| Divno | Divname | Location |
|---|---|---|
| 10 | Media | TF02 |
| 20 | Dance | FF02 |
| 30 | Production | SF01 |
(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 ?
(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;+----------+---------+
| Name | Divname |
+----------+---------+
| SHANKHYA | Media |
| SUNISH | Dance |
+----------+---------+