English

Name foreign keys in table ATTENDANCE and STUDENT. Is there any foreign key in table GUARDIAN. ATTENDANCE Attribute Name RollNumber SName SDateofBirth GUID

Advertisements
Advertisements

Question

Name foreign keys in table ATTENDANCE and STUDENT. Is there any foreign key in table GUARDIAN.

ATTENDANCE

Attribute Name Data expected to be stored Data Type Constraint
RollNumber Numeric value consisting of maximum 3 digits INT PRIMARY KEY
SName Variant length string of maximum 20 characters VARCHAR(20) NOT NULL
SDateofBirth Date value DATE NOT NULL
GUID Numeric value consisting of 12 digits CHAR(12) FOREIGN KEY

STUDENT

Attribute Name Data expected to be stored Data Type Constraint
GUID Numeric value consisting of 12 digit Aadhaar number CHAR(12) PRIMARY KEY
GName Variant length string of maximum 20 characters VARCHAR(20) NOT NULL
GPhone Numeric value consisting of 10 digits CHAR(10) NULL UNIQUE
GAddress Variant length string of size 30 characters VARCHAR(30) NOT NULL

GUARDIAN

Attribute Name Data expected to be stored Data Type Constraint
AttendanceDate Date value DATE PRIMARY KEY*
RollNumber Numeric value consisting of maximum 3 digits INT PRIMARY KEY*, FOREIGN KEY
AttendanceStatus ‘P’ for present and ‘A’ for absent CHAR(1) NOT NULL
Code Writing
Advertisements

Solution

  • STUDENT table: GUID is a Foreign Key. It refers to GUID in the GUARDIAN table.
  • ATTENDANCE table: RollNumber is a Foreign Key. It refers to RollNumber in the STUDENT table.
  • GUARDIAN table: There is no Foreign Key. GUID is its Primary Key.
Table Foreign Key References
STUDENT GUID GUARDIAN(GUID)
ATTENDANCE RollNumber STUDENT(RollNumber)
GUARDIAN None ,

The foreign key in STUDENT is GUID, and the foreign key in ATTENDANCE is RollNumber. There is no foreign key in the GUARDIAN table.

shaalaa.com
  Is there an error in this question or solution?
Chapter 8: Introduction to Structured Query Language (SQL) - Intext Questions [Page 148]

APPEARS IN

NCERT Informatics Practices [English] Class 11
Chapter 8 Introduction to Structured Query Language (SQL)
Intext Questions | Q 8. | Page 148
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×