Question
Consider the following Relational Schema for a Hospital:
- Doctor (ID, DoctorName, Speciality, JoinDate)
Where ID is the unique identifier for the doctor (Primary Key), and Speciality indicates the doctor's area of expertise.
- Patient (PID, PatientName, Phone, ID)
Where PID is the unique identifier for the patient (Primary Key), and ID links the patient to their primary care doctor (Foreign Key).
a) Write the SQL statements to create these tables. You must include definitions for Primary Keys, Foreign Keys, and necessary constraints. Insert a few rows of meaningful data into each table.
Answer :
Word Count : 201
__________ ____ ___ ___ ____ _________ _____ _________ _______ ______ ________.
_____ ___ _____ ___ __________ ______ _____ ______ ______ ______ __________.
___ ______ ___ _______ ___ ____ __________.
_______ ____ ___ _____ _________ ______ ______ ___ ______ ____ _________ ___.
________ ___ ________ ____ _____ ____ ___ _____ ___ ___.
__________ _______ _______ _______ ______ ____ ___ ______ ______ ______ __________.
___ ______ _______ _________ ______ _______ _______ _________ ___ ________ _____.
_______ ______ ______ ____ ___ ____ _______ ___ __________ __________ __________ _______.
______ ______ ________ ____ __________ ________ ________ __________ ______ ____.
_____ _______ _________ __________ ______ _____ _____.
____ ______ ____ ____ _____ _________ __________ _______.
____ ______ ________ ____ __________ ___ ________ _______ ___ ________.
___ ___ _____ __________ _________ __________ ___ ____ _______ _____.
_________ _______ _______.
Skip in 10
The relational schema can be implemented using SQL by defining the Doctor table first, followed by the Patient table with proper key constraints to maintain referential integrity. The Doctor table includes a primary key on ID, and the Patient table includes a foreign key referencing the Doctor table. ```sql CREATE TABLE Doctor ( ID INT PRIMARY KEY, DoctorName VARCHAR(100) NOT
________ ________ _________ ____ _________ _______ _____ ________.__________ ____ ___ ___ ____ _________ _____ _________ _______ ______ ________.
_____ ___ _____ ___ __________ ______ _____ ______ ______ ______ __________.
___ ______ ___ _______ ___ ____ __________.
_______ ____ ___ _____ _________ ______ ______ ___ ______ ____ _________ ___.
________ ___ ________ ____ _____ ____ ___ _____ ___ ___.
__________ _______ _______ _______ ______ ____ ___ ______ ______ ______ __________.
___ ______ _______ _________ ______ _______ _______ _________ ___ ________ _____.
_______ ______ ______ ____ ___ ____ _______ ___ __________ __________ __________ _______.
______ ______ ________ ____ __________ ________ ________ __________ ______ ____.
_____ _______ _________ __________ ______ _____ _____.
____ ______ ____ ____ _____ _________ __________ _______.
____ ______ ________ ____ __________ ___ ________ _______ ___ ________.
___ ___ _____ __________ _________ __________ ___ ____ _______ _____.
_________ _______ _______.
IGNOU ACADEMY
Your IGNOU journey, made easier.
- Solved Assignments
- Study Notes
- Guess Papers
- Question Papers
Continue Reading — It's Free
Sign in with Google to unlock more of this answer.
✓ Free access
✓ Unlock up to 60% of the answer
✓ No payment required
✓ Unlock up to 60% of the answer
✓ No payment required
Quick Google sign-in. No separate registration form.