Fewpal
0 votes
27 views
in Information Technology by (47.6k points)
closed by

Consider the following tables PATIENT and TEST and answer the questions that follow :

PCODENAMEPHONEDTADMITTESTID
6473Amit Sharma91235689919 - JUN - 2017T102
7134Rose Mathew88674453612 - NOV - 2017T101
8786Tina Sharma Arora88908876506 - DEC - 2017T102
6477Vijay Shah71456744507 - DEC - 2017T502
7658Venkat Fazal86554534331 - DEC - 2017T101

Note : 

  • NAME holds the Names of patients. 
  • DTADMIT holds dates on which a patient was admitted to hospital. 
  • TESTID holds Ids of Medical tests done on patients.
TESTIDTESTNAMECOST
T101Platelet Count200.00
T102Hemogram190.00
T301Malaria Detection350.00
T502Glucose test150.00

Name the Primary keys in both the tables and foreign key in ‘PATIENT’ table. State the reason for your choice.

1 Answer

+1 vote
by (52.3k points)
selected by
 
Best answer

Primary key in PATIENT and TEST tables are PCODE and TESTID respectively. Because primary key of a relational table uniquely identifies each record. 

Foreign key in PATIENT table is TESTID whose value is derived from the primary key (TESTID) of another table (TEST).

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...