0% found this document useful (0 votes)
61 views

Database Design Language For The Final Project

The document describes a database for a pharmacy with tables for patients and prescriptions. The patient table stores patient details with a primary key of MRN. The prescription table stores prescription details for each patient, including the medication name, directions, quantity filled, and refills, with a primary key of RxNum and a foreign key of MRN linking to the patient. A patient can have multiple prescriptions, representing a one-to-many relationship between the patient and prescription tables.

Uploaded by

api-551332616
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views

Database Design Language For The Final Project

The document describes a database for a pharmacy with tables for patients and prescriptions. The patient table stores patient details with a primary key of MRN. The prescription table stores prescription details for each patient, including the medication name, directions, quantity filled, and refills, with a primary key of RxNum and a foreign key of MRN linking to the patient. A patient can have multiple prescriptions, representing a one-to-many relationship between the patient and prescription tables.

Uploaded by

api-551332616
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Running head: DATABASE DESIGN LANGUAGE 1

DBDL Final Project

Jessica Ndegwa

University of San Diego


DATABASE DESIGN LANGUAGE 2

Pharmacy Database

A pharmacy has a database of different types of medicines. The database should store the

details of all prescriptions brought by patients. A prescription belongs to one patient. A patient

can have multiple prescriptions. Tables:

• Patient

Patient (MRN, Street, City, State, Zipcode, PhoneNum)

- MRN is the primary key for the Patient table and cannot be null.

• Prescription

Prescription (RxNum, MedicationName, Directions, Qtyfilled, Refill, PSBR,

MRN)

- RxNum is the primary key for the Patient table and cannot be null.

- Both Patient and Prescription tables have the MRN field in common. The MRN field in the

Prescription table is a foreign key that must match the primary key of the Patient table.

Patient and Prescription have a one-to-many relationship:

Patient (MRN, Street, City, State, Zipcode, PhoneNum)

Prescription (RxNum, MedName, Directions, Qtyfilled, Refill, PSBR, MRN)

• Patient

Patient (MRN, Street, City, State, Zipcode, PhoneNum)

SK PhoneNum

- No alternate key identified

- No foreign key identified

• Prescription

Prescription (RxNum, MedName, Directions, Qtyfilled, Refill, PSBR, MRN)


DATABASE DESIGN LANGUAGE 3

AK MedName

SK MedName

FK MRN Patient

You might also like