Name foreign keys in table ATTENDANCE and STUDENT. Is there any foreign key in table GUARDIAN.
| Attribute Name | Data type | Constraint |
|---|---|---|
| RollNumber | INT | PRIMARY KEY |
| SName | VARCHAR(20) | NOT NULL |
| SDateofBirth | DATE | NOT NULL |
| GUID | CHAR(12) | FOREIGN KEY |
Table: STUDENT
| Attribute Name | Data type | Constraint |
|---|---|---|
| GUID | CHAR(12) | PRIMARY KEY |
| GName | VARCHAR(20) | NOT NULL |
| GPhone | CHAR(10) | NULL UNIQUE |
| GAddress | VARCHAR(30) | NOT NULL |
Table: GUARDIAN
| Attribute Name | Data type | Constraint |
|---|---|---|
| AttendanceDate | DATE | PRIMARY KEY* |
| RollNumber | INT | PRIMARY KEY* and FOREIGN KEY |
| AttendanceStatus | CHAR(1) | NOT NULL |
Table: ATTENDANCE — * = part of composite primary key.
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 question tests your understanding of foreign keys — a constraint that links a column in one table to the primary key of another. In the given schema, ATTENDANCE has a foreign key referencing STUDENT, and STUDENT has a foreign key referencing GUARDIAN. GUARDIAN itself has no foreign key.
This is a plain theory question about database schema design — specifically, identifying foreign keys from a table definition. Let's walk through each table.
STUDENT table
The schema says: GUID CHAR(12) FOREIGN KEY. That means the GUID column in STUDENT is a foreign key. It must reference the primary key of some other table — and the only table with GUID as its primary key is GUARDIAN. So STUDENT has one foreign key: GUID → GUARDIAN(GUID).
ATTENDANCE table
The schema says: RollNumber INT PRIMARY KEY* and FOREIGN KEY. The asterisk means it's part of the composite primary key (along with AttendanceDate), but it's also explicitly declared as a foreign key. That foreign key must reference the RollNumber column in STUDENT (the only table with RollNumber as primary key). So ATTENDANCE has one foreign key: RollNumber → STUDENT(RollNumber).
GUARDIAN 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.