Lab 2

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

LAB2_1

Normal Form
Below data is used to describe information of treatment for pets at a pet medical center. Using decomposition
technique to model these data into relational model basing normal forms. You should start from 1NF to 3NF.

1. Healthy history report

2. Invoice

PET ID PET NAME PET TYPE PET AGE OWNERVISIT DATE PROCEDURE

246 ROVER DOG 12 SAM COOK JAN 13/2002 01 - RABIES VACCINATION

MAR 27/2002 10 - EXAMINE and TREAT WOUND

APR 02/2002 05 - HEART WORM TEST

298 SPOT DOG 2 TERRY KIM JAN 21/2002 08 - TETANUS VACCINATION

MAR 10/2002 05 - HEART WORM TEST

341 MORRIS CAT 4 SAM COOK JAN 23/2001 01 - RABIES VACCINATION

JAN 13/2002 01 - RABIES VACCINATION

519 TWEEDY BIRD 2 TERRY KIM APR 30/2002 20 - ANNUAL CHECK UP

APR 30/2002 12 - EYE WASH

HILLTOP ANIMAL HOSPITAL DATE: JAN 13/2002

INVOICE # 987

MR. RICHARD COOK - 123 THIS STREET - MY CITY, ONTARIO

Z5Z 6G6

PET PROCEDURE AMOUNT

ROVER RABIES VACCINATION 30.00

MORRIS RABIES VACCINATION 24.00

TOTAL 54.00

TAX (8%) 4.32

AMOUNT OWING 58.32


PET I PET NAM PET TYP PET AG OWNER VISIT DATE PROCEDURE_I PROCEDURE_ Description
D E E E D
246 ROVER BIRD 12 SAM JAN 13/2002 01 RABIES VACCINATION
COOK
246 ROVER BIRD 12 SAM MAR 272002 10 EXAMINE and TREAT WOUND
COOK
246 ROVER BIRD 12 SAM APR 02/2002 05 HEART WORM TEST
COOK
298 SPOT CAT 2 TERRY KI JAN 21/2002 08 TETANUS VACCINATION
M

298 SPOT CAT 2 TERRY MAR 10/2002 05 HEART WORM TEST


KIM

341 MORRIS CAT 4 SAM JAN 23/2001 01 RABIES VACCINATION


COOK

341 MORRIS CAT 4 SAM JAN 13/2002 01 RABIES VACCINATION


COOK

519 TWEEDY BIRD 2 TERRY KI APR 30/2002 20 ANNUAL CHECK UP


M

519 TWEEDY BIRD 2 TERRY APR 30/2002 12 EYE WASH


KIM

1NF:
2NF

PROCEDURE (key: PROCEDURE_ID)


Pet (key: PET ID)
PET I PET NAM PET TYP PET AG OWNER PROCEDURE_ID PROCEDURE_ Description
D E E E 01 RABIES VACCINATION
246 ROVER BIRD 12 SAM COOK 05 HEART WORM TEST
298 SPOT CAT 2 TERRY KIM 08 TETANUS VACCINATION
341 MORRIS CAT 4 SAM COOK 10 EXAMINE and TREAT WOUND
12 EYE WASH
519 TWEEDY BIRD 2 TERRY KIM
20 ANNUAL CHECK UP
1
1
8 8

PET ID PROCEDURE_ID VISIT DATE


246 01 JAN 13/2002
246 10 MAR 27/2002
246 05 APR 02/2002
298 08 JAN 21/2002
298 05 MAR 10/2002
341 01 JAN 23/2001
341 01 JAN 13/2002
519 20 APR 30/2002
519 12 APR 30/2002
Date (key: PET ID + PROCEDURE_ID)
3NF:

Pet (key: PET ID)


PROCEDURE (key: PROCEDURE_ID)

PET I PET NAM PET TYP PET AG OWNER PROCEDURE_ID PROCEDURE_ Description
D E E E 01 RABIES VACCINATION
246 ROVER BIRD 12 SAM COOK 05 HEART WORM TEST
1
298 SPOT CAT 2 TERRY KIM 08 TETANUS VACCINATION
341 MORRIS CAT 4 SAM COOK 10 EXAMINE and TREAT WOUND
519 PET ID PROCEDURE_ID VISIT DATE EYE WASH
TWEEDY BIRD 2 TERRY KIM 12
246 01 JAN 13/2002 ANNUAL CHECK UP
246 10 MAR 27/2002 1
20
8
246 05 APR 02/2002
298 08 JAN 21/2002
298 05 MAR 10/2002
341 01 JAN 23/2001
341 01 JAN 13/2002
519 20 APR 30/2002
519 12 APR 30/2002

Date (key: PET ID + PROCEDURE_ID)

Câu 2:
INVOICE_ID INVOICE_ OWNER OWNER Pet_id Pet_name Procedure Amount
DATE _ADDRESS
987 Jan Mr.Richard 123 This Street, 01 Rover Rabies 30.00
13/2002 Cook My City, Ontario Vaccination

987 Jan Mr.Richard 123 This Street, 02 Morris Rabies 24.00


13/2002 Cook My City, Ontario Vaccination

1NF

2NF

INVOICE (key: INVOICE_ID) PET (key: Pet_id)

INVOICE_ID INVOICE_DATE OWNER OWNER Pet_id Pet_name


_ADDRESS 01 Rover
987 Jan 13/2002 Mr.Richard 123 This Street, 02 Morris
Cook My City, Ontario
8 8 1
1

INVOICE_ID Pet_id Procedure Amount

987 01 Rabies 30.00


Vaccination

987 02 Rabies 24.00


Vaccination

3NF:

INVOICE (key: INVOICE_ID)


INVOICE_ID INVOICE_DATE OWNER_ID
987 Jan 13/2002 01

1
1

OWNER_INFO (key: OWNER_ID)


8
OWNER_ID OWNER cust_street cust_city cust_pstlcd
01 Mr.Richard Cook 123 This Ontario Z5Z 6G6
Street,

Amount (key: INVOICE_ID + Pet_id)


8
INVOICE_ID Pet_id Procedure Amount

987 01 Rabies 30.00


Vaccination

987 02 Rabies 24.00


Vaccination

8
1
PET (key: Pet_id)
Pet_id Pet_name
01 Rover
02 Morris

You might also like