DOC PREVIEW
UT Dallas CS 6385 - T2_Sol

This preview shows page 1 out of 4 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

5CCS02DB Database SystemsLecturer: Sophia TsokaTeaching Assistants: Yiannis Siantos, Christos HadjinikolisOctomber 6, 2011 – 2nd Tutorial1 ExerciseDesign a Database for prescription monitoring based on the given data:• Patients are defined by an identity number, a name and a surname, and by a birth-date.• Doctors are defined as well by an identity number, a name, a surname, and a birth-date,while additionally they will be characterised by a work start date and a specialty.• Pharmaceutical companies will be defined by a name, and a telephone number.• Medicines will be defined by a commercial name, their manufacturer, and their activeingredient.• Pharmacies will be defined by a name, an address and a telephone number.Additionally you should take into account the following:• Each patient has one doctor• Each doctor has at least one patient• A doctor can prescribe certain medicines to his patients• Each pharmacy sells several medicines, each at a specific price• Each medicine can be sold by several pharmacies possibly at a different price• Pharmaceutical companies have contracts with pharmacies• Each pharmaceutical company may have contracts with several pharmacies• Each pharmacy may have contracts with several pharmaceutical companies• For each contract there is a start date, an end date and the contract contents.• For each contract there is always a person responsible for it, which may change at anypoint while the contract is still in effect.12 ExerciseConsider the following set of requirements for a university database that is used to keep track ofstudents’ transcripts.• The university keeps track of each student’s name, student number, social security number,current address and phone, permanent address and phone, birth date, sex, class (freshman,sophomore, ,.., graduate), major department, minor department (if any), and degree pro-gram (B.A., B.S., ..., Ph.D.). Some user applications need to refer to the city, state, andzip of the student’s permanent address, and to the student’s last name. Both social securitynumber and student number have unique values for each student.• Each department is described by a name, department code, office number, office phone,and college. Both name and code have unique values for each department.• Each course has a course name, description, course number, number of semester hours,level, and offering department. The value of course number is unique for each course.• Each section has an instructor, semester, year, course, and section number. The sectionnumber distinguishes different sections of the same course that are taught during the samesemester/year; its values are 1, 2, 3, ...; up to the number of sections taught during eachsemester.• A grade report has a student, section, letter grade, and numeric grade (0, 1, 2, 3, 4 for F, D,C, B, A, respectively).Design an ER schema for this application, and draw an ER diagram for that schema. Specifykey attributes of each entity type and structural constraints on each relationship type. Note anyunspecified requirements, and make appropriate assumptions to make the specification complete.2(1,N) (1,N) (0,N) (1,N) (0,N) Doctor Id name surname DOB Specialization Start Date Company Name Phone Medicine Name Act. Ingredient Has Contract Start Date End Date Content Responsible Perscription Sells Price (0,N) (1,1) (1,N) (1,N) Assumptions: - Each doctor will prescribe at least 1 medicine to some patient - While each pharmacy must sell at least one type of medicine it is not necessary for a medicine to have a pharmacy that sells it (thus the minimum of 0 in the relationship) - A company must have at least one contract with a pharmacy in order for it to be viable. A pharmacy must have at least 1 contract with a company in order to be able to sell medicine. - A medicines name uniquely identifies it due to the fact that it is required to be a registered trademark. Patient Id name surname DOB Pharmacy Name Phone Address Solution


View Full Document

UT Dallas CS 6385 - T2_Sol

Documents in this Course
assn1

assn1

2 pages

38rel2

38rel2

5 pages

Report

Report

3 pages

networks

networks

18 pages

lp2

lp2

44 pages

lp2 (2)

lp2 (2)

27 pages

lp1(1)

lp1(1)

21 pages

integer1

integer1

50 pages

FrankR2

FrankR2

3 pages

duality

duality

28 pages

CMST

CMST

44 pages

hw4

hw4

3 pages

for 1

for 1

11 pages

ENCh02

ENCh02

33 pages

pree

pree

2 pages

new  3

new 3

2 pages

new  2

new 2

2 pages

hw4a

hw4a

2 pages

ISM3

ISM3

8 pages

hw4_sol

hw4_sol

6 pages

Elm04_06

Elm04_06

11 pages

atn proj2

atn proj2

20 pages

12CUT1

12CUT1

8 pages

09Ford

09Ford

23 pages

08FLOW

08FLOW

6 pages

03LP_su

03LP_su

6 pages

40REL40

40REL40

5 pages

39rel3

39rel3

5 pages

38arel2

38arel2

5 pages

37REL1

37REL1

3 pages

24TABU

24TABU

3 pages

22DYNPR

22DYNPR

3 pages

21B&C

21B&C

2 pages

20BBEX0

20BBEX0

3 pages

19BB

19BB

5 pages

14CAPBUD0

14CAPBUD0

11 pages

35BRXCH

35BRXCH

2 pages

34COMB

34COMB

4 pages

32CAPAS

32CAPAS

4 pages

31QUEUE

31QUEUE

3 pages

Load more
Download T2_Sol
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view T2_Sol and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view T2_Sol 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?