For the above given database STUDENT-PROJECT, answer the following:
Student Project Database
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 |
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 |
- Name primary key of each table.
- Find foreign key(s) in table PROJECT-ASSIGNED.
- Is there any alternate key in table STUDENT? Give justification for your answer.
- 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 →This solution identifies primary keys, foreign keys, and alternate keys in the given database schema, and explains the uniqueness constraint on primary keys.
Understanding the structure of a database, specifically its keys, is fundamental to designing efficient and reliable systems. Keys define relationships between tables and enforce data integrity, ensuring that data is consistent and accurate. Let's break down the concepts for the STUDENT-PROJECT database.
(a) Name primary key of each table.
A primary key is a column or a set of columns that uniquely identifies each row in a table. It must contain unique values for each row and cannot contain NULL values. Its purpose is to ensure entity integrity, meaning every entity (row) in the table is uniquely identifiable.
-
Table: PROJECT
The
ProjectNocolumn contains unique values (101, 102, 103, 104, 105, 106) for each project and does not appear to have any NULL values. It serves as a clear identifier for each project.ImportantThe primary key for the
PROJECTtable is ProjectNo. -
Table: PROJECT ASSIGNED
This table links students to projects. Neither
Registration_IDnorProjectNoalone can uniquely identify a row, as a student might be assigned multiple projects (though not shown in this sample, it's a possibility in a real system), or a project might be assigned to multiple students. However, the combination ofRegistration_IDandProjectNouniquely identifies each assignment record. For example,(IP-101-15, 101)is a unique pair.ImportantThe primary key for the
PROJECT ASSIGNEDtable is the composite key (Registration_ID, ProjectNo). -
Table: STUDENT
The
Roll Nocolumn contains unique values (11, 12, 21, 22, 23) for each student and does not contain NULL values. It is the most natural and common identifier for students in an academic context.ImportantThe primary key for the
STUDENTtable is Roll No.
(b) Find foreign key(s) in table PROJECT ASSIGNED.
A foreign key is a column or a set of columns in one table that refers to the primary key in another table. It establishes a link between two tables, enforcing referential integrity. This means that values in the foreign key column(s) must either match a value in the primary key of the referenced table or be NULL (if allowed).
In the PROJECT ASSIGNED table:
- The
Registration_IDcolumn contains values like 'IP-101-15', 'IP-104-15', 'CS-103-14', etc. These values correspond to theRegistration_IDcolumn in theSTUDENTtable, which is an alternate key (and a candidate for a primary key) in that table. This establishes a link between an assignment and a specific student. - The
ProjectNocolumn contains values like 101, 103, 102, etc. These values correspond to theProjectNocolumn in thePROJECTtable, which is its primary key. This establishes a link between an assignment and a specific project.
Therefore, PROJECT ASSIGNED has two foreign keys.
The foreign keys in the PROJECT ASSIGNED table are Registration_ID (referencing STUDENT table) and ProjectNo (referencing PROJECT table).
(c) Is there any alternate key in table STUDENT? Give justification for your answer.
An alternate key is any candidate key that is not chosen as the primary key for a table. A candidate key is a minimal set of attributes that can uniquely identify a tuple (row) in a table. It must be unique and non-nullable.
In the STUDENT table:
- We identified
Roll Noas the primary key because it uniquely identifies each student. - Consider the
Registration_IDcolumn. Its values ('IP-101-15', 'IP-104-15', 'CS-103-14', 'CS-101-14', 'CS-101-10') are unique for each student in the table and do not contain NULL values. This meansRegistration_IDalso has the properties of a candidate key.
Since Registration_ID is a candidate key but Roll No was chosen as the primary key, Registration_ID qualifies as an alternate key.
Yes, Registration_ID is an alternate key in the STUDENT table.
…
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.