0% found this document useful (0 votes)
61 views4 pages

Assignment - 3 2021 Ten Have

The document provides details for Assignment #3 in a BMI 544/644 course. It includes exercises on sets, relations, and relational database schemas. Exercise 4.1 finds the Cartesian product of two sets. Exercise 4.3 provides a book relation schema and asks to write the relation instance and identify a primary key. Exercise 4.6 provides an E-R diagram and asks for the corresponding relational schema. Exercise 4.12 provides an E-R diagram for a physical therapy center and asks for the relational schema. Exercise 4.15 provides an E-R diagram for a dental office and asks for the relational schema to represent the data, including specialization of dentists.

Uploaded by

Andrew Ten Have
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 views4 pages

Assignment - 3 2021 Ten Have

The document provides details for Assignment #3 in a BMI 544/644 course. It includes exercises on sets, relations, and relational database schemas. Exercise 4.1 finds the Cartesian product of two sets. Exercise 4.3 provides a book relation schema and asks to write the relation instance and identify a primary key. Exercise 4.6 provides an E-R diagram and asks for the corresponding relational schema. Exercise 4.12 provides an E-R diagram for a physical therapy center and asks for the relational schema. Exercise 4.15 provides an E-R diagram for a dental office and asks for the relational schema to represent the data, including specialization of dentists.

Uploaded by

Andrew Ten Have
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/ 4

Assignment #3 BMI 544/644, Winter 2021

(60 points possible)


Name:

Due: Wednesday, January 27 at 11:55 PM Pacific time

4.1 (5 points)
Let S = {red, yellow, green} and T = {plaid, stripe,
dot}. Find the Cartesian product of S and T.

S x T = {red, yellow, green} x {plain, stripe, dot}

= {(red, plaid), (red, stripe), (red, dot),


(yellow, plaid), (yellow, stripe), (yellow, dot),
(green, plaid), (green, plaid), (green, dot)}

4.3 (10 points)


Consider the relation schema containing book data for a bookstore:
Book (title, author, isbn, publisher, pubDate, pubCity, qtyOnHand)

a. Write out the table for an instance of this relation.


Book
title author isbn publisher pubDate pubCity qtyOnHand
Unconventional Kresser, 978-1- Lioncrest 2017 Berkeley 100
Medicine Chris 61961-
747-6
Unconventional Ballantyne, 978-1- Lioncrest 2017 Berkeley 100
Medicine Sarah 61961-
747-6
Atlas of Human Netter, 0- Ciba-Geigy 1989 Summit, 3
Anatomy Frank 914168- Corporation New
19-3 Jersey
Atlas of Human Netter, 0- Ciba-Geigy 1992 Summit, 5
Anatomy Frank 914168- Corporation New
19-4 Jersey

Assumptions:
1. Assume that author can have multiple values. Therefore, isbn in BOOK is not necessarily
unique. The first 2 records in the instance above are examples of this.
2. The goal of this exercise is to find a primary key that uniquely identifies records (tuples) in
the Book schema (it’s not necessarily a commonsense key for identifying unique books).
3. Assume author values are always spelled correctly and consistently: e.g., Last First Middle.
4. Different editions (of the same title/author/publisher) always have different isbn numbers
and different publishing dates.
4.3b Given the above assumptions, I can propose some example keys:
superkey: title, author, isbn, publisher, pubDate
candidate keys: author, isbn or title, author, publisher, pubDate
primary key: author, isbn

NOTE:
From the text and lecture, I know that the correct way to handle a multiple-valued attribute
(like author) is to move it into a weak entity, with isbn as a key in both tables. But for this
exercise, I wanted to experiment with would happen if you don’t make a 2nd table for the
multi-valued author attribute.

4.6 (10 points) Relational DB schema for Customer Order E-R diagram Fig 4.9
NOTE: this answer assumes that qualified attribute names are sufficient for distinguishing
the identical non-qualified attributes names from eachother;
e.g., Customer.number ^= Order.number.

Customer (custID, creditLimit, lastName, firstName, street, city, state, zip, areaCode,
number)

Order (orderNo, custId, date, totalAmount, tax, street, city, state, zip, areaCode, number)

Contains (orderNo, orderedItemNo, Quantity)

Item (ItemNo, ItemName, unitPrice, qtyOnHand, reorderPoint)

Supplies (suppliesItemNo, supplierNo, unitCost)

Supplier (supplierNo, contactName, supName, countryCode, areaCode, number, street,


city, state, postalCode, country)

4.12 (15 points) Relational DB schema for Physical Therapy Center described in given figure:
Patient 1 has M Prescription M from 1 Physician
1
1

covers
scheduled
M

M
Visit
M
treats 1
Therapist
Appointment
1

includes
used
1
1

Equipment
Treatment
4.12 Answer
Patient (patientID, patientLastName, patientFirstName, patienttDOB, …)

Appointment (apptPatientID, apptDate, apptTime, …, apptDesc, …)

Prescription (rxNo, rxPatientID, mdNPI, …, primaryICD10, …)

Physician (mdNPI, …, mdName, mdAddress, mdPhone, …)

Visit (visitNo, visitRxNo, visitTherapistNPI, visitEquipmentID, …, visitDate, …)

Therapist (therapistNPI, …, therapistName,…)

Equipment (equipmentID, …, equipmentServiceDate, …)

Treatment (visitNo, treatmentName, …, txDescription, …)

4.15 (20 points) Design a relational database schema for the data described in Exercise 3.11,
including the specialization of dentists:
NOTE: “Person” generalization is not represented (Method 2).

Patient (ptId, …, ptName, ptPhone, ptAddress,…)


Visit (visitNo, ptID, …, visitDate, visitTime, …dentistNPI)
Initial (iniitalVisitNo, hygienistID)
WorkNeeded (initialVisitNo, workItemNo, …)
Surgical (surgicalVisitNo, surgAsstHygienistNPI, surgeonDentistNPI)
Charge (visitNo, chargeNo, …, chargeAmt, …)
Payment (visitNo, paymentNo, …, paymentAmt, …)
ProcedureService (visitNo, procServCode, …, procServDesc, …)
Uses (procServCode, supplyNo)
Supply (suppNo, labNo, …, unitCost, qtyOnHand…)
Laboratory (labNo, …, labName, labAddress, …)

Professional (NPI, …, profName, profAddress, LicenseNo, …)


Dentist (dentistNPI, …, dentistName,…)
Surgeon (surgeonDentistNPI, …surgicalPayModifier,…)
# I thought of using method 3 to subset surgeons—for example, adding attribute
“surgeonYesNo” to the Dentist entity; but this would remove the built-in
constraint which prevents non-surgeons from being linked to surgical visits.
Hygienist (hygienistNPI, …, hygienistName, …)
SurgAsst (surgAsstHygienistNPI, …surgAsstPayModifier,…)

Person

U
U

Patient Professional
(0,M

o
)

Charge

U
U

Makes
(1,1
)
Dentist Hygienist
)

incurs
,M
1,1

(0
(0

conducts U U
,M

)
)

,1
(1

covers (0,M) Visit Surgeon SurgAsst


(0,M)

)
, M
(0
M)
1,1

o
(0,

(0,M)

includes performs
U

U
Payment assists
1,1
Initial Surgical (1,1)
(1
,1
)

) M
(0,
Procedure/
(1,1)
Service
shows
(0,M ( 1 ,1
) )
works
Work
uses
Needed

(0,M)

Laboratory (1,M) provides (1,1) Supply

You might also like