For the above given database STUDENT-PROJECT, answer the following:
Student Project Database
Table: STUDENT
| Roll No | Name | Class | Section | Registration_ID |
|---|---|---|---|---|
| 11 | Mohan | XI | 1 | IP-101-15 |
| 12 | Sohan | XI | 2 | IP-104-15 |
| 21 | John | XII | 1 | CS-103-14 |
| 22 | Meena | XII | 2 | CS-101-14 |
| 23 | Juhi | XII | 2 | CS-101-10 |
Table: PROJECT
| ProjectNo | PName | SubmissionDate |
|---|---|---|
| 101 | Airline Database | 12/01/2018 |
| 102 | Library Database | 12/01/2018 |
| 103 | Employee Database | 15/01/2018 |
| 104 | Student Database | 12/01/2018 |
| 105 | Inventory Database | 15/01/2018 |
| 106 | Railway Database | 15/01/2018 |
Table: PROJECT ASSIGNED
| Registration_ID | ProjectNo |
|---|---|
| IP-101-15 | 101 |
| IP-104-15 | 103 |
| CS-103-14 | 102 |
| CS-101-14 | 105 |
| CS-101-10 | 104 |
a) Name primary key of each table.
b) Find foreign key(s) in table PROJECT-ASSIGNED.
c) Is there any alternate key in table STUDENT? Give justification for your answer.
d) Can a user assign duplicate value to the field RollNo of STUDENT table? Jusify.
You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.
Start your 14-day free trial to unlock the full solution →A primary key uniquely identifies every row, an alternate key is a candidate key that was not chosen as the primary key, and a foreign key links a row to a row of another table.
Here: STUDENT → RollNo, PROJECT → ProjectNo, PROJECT-ASSIGNED → Registration_ID; both columns of PROJECT-ASSIGNED are foreign keys; Registration_ID is STUDENT's alternate key; and a duplicate RollNo is impossible because the DBMS enforces primary-key uniqueness.
a) Primary key of each table
A primary key must be unique and non-NULL for every row. Scan each table's data:
| Table | Primary key | Why it qualifies |
|---|---|---|
| STUDENT | RollNo | 11, 12, 21, 22, 23 — one distinct number per student |
| PROJECT | ProjectNo | 101–106 — every project is numbered exactly once |
| PROJECT-ASSIGNED | Registration_ID | each registration ID appears in exactly one assignment row |
(If the school ever allowed one student to work on several projects, Registration_ID alone would repeat, and the composite key (Registration_ID, ProjectNo) would be needed. With the given one-project-per-student data, Registration_ID suffices.)
b) Foreign key(s) in PROJECT-ASSIGNED
Both of its columns point at rows of other tables:
Registration_ID→ referencesRegistration_IDof STUDENTProjectNo→ referencesProjectNoof PROJECT
That is exactly what makes PROJECT-ASSIGNED a linking table: every value it stores must already exist in the parent tables (referential integrity).
c) Alternate key in STUDENT
Yes — Registration_ID. STUDENT actually has two candidate keys: RollNo and Registration_ID. Check the data: IP-101-15, IP-104-15, CS-103-14, CS-101-14, CS-101-10 are all different, and a registration ID identifies exactly one student. Since RollNo was picked as the primary key, the remaining candidate key — Registration_ID — is by definition the alternate key. (Name, Class, Section cannot be keys: two students could easily share any of them.)
d) Can a user give RollNo a duplicate value?
No. RollNo is the primary key of STUDENT, and a DBMS enforces uniqueness (and NOT NULL) on the primary key automatically. This is how the table is declared and what happens on the attempt:
CREATE TABLE STUDENT (
RollNo INT PRIMARY KEY,
Name VARCHAR(30),
Class VARCHAR(5),
Section INT, …
Unlock everything free for 14 days
- Full step-by-step solutions
- Concept-first explanations
- Methods, shortcuts & mistakes
- PYQ mapping + timed mock tests
Full access for 14 days. No credit card required.