If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Entity or Relationship Attribute??

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-29-10, 06:40
ftl25 ftl25 is offline
Registered User
 
Join Date: Oct 2010
Posts: 8
Entity or Relationship Attribute??

Hi,

I have the following piece of text:

The practice provides various treatments for all types of pets. These treatments are provided at a
standard rate across all clinics. The details of each treatment include a treatment number, a full
description of the treatment, and the cost to the pet owner.
The treatment number uniquely identifies each type of treatment and is used by all clinics. Based on the
results of the examination of a sick pet, the vet may propose one or more types of treatment. For each
type of treatment, the information recorded includes the examination number and date, the pet
number, name and type, treatment number, description, quantity of each type of treatment, and date
the treatment is to begin and end. Any additional comments on the provision of each type of treatment
are also recorded.


So, there are the following (definite) entities:

Clinic
Staff (Vet)
Examination
Pet
Treatment -- Treatment No {PK}, Description, Cost

I am confused however about "Type of Treatment". Could this be another entity? Or could it be part of a relationship as follows:
Examination -- Determines -- Treatment, and in the "Determines" relationship, data is recorded (the examination number and date, the pet
number, name and type, treatment number, description, quantity of each type of treatment, and date
the treatment is to begin and end)

Any help or advice appreciated.
Reply With Quote
  #2 (permalink)  
Old 10-29-10, 07:57
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Quote:
Originally Posted by ftl25 View Post
I am confused however about "Type of Treatment". Could this be another entity?
you betcha
Quote:
The treatment number uniquely identifies each type of treatment and is used by all clinics
if the clinics are all using the same treatment number, then yeah, treatment type is an entity
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 10-29-10, 08:10
ftl25 ftl25 is offline
Registered User
 
Join Date: Oct 2010
Posts: 8
Hi,

Yes, I was thinking that "Type of Treatment" is definitely an entity:
Type of Treatment -- treatment number{PK}, full description of the treatment, cost to pet owner

but it mentions other attributes - For each
type of treatment, the information recorded includes the examination number and date, the pet
number, name and type, treatment number, description, quantity of each type of treatment, and date
the treatment is to begin and end. Any additional comments on the provision of each type of treatment
are also recorded.


Would this imply that there are two entities here: Type of Treatment and, say Pet Treatment?

Pet Treatment -- Exam No {CK}, Date, Pet Number {PK}, Pet Name & Type, Treatment Number {CK}, Description, etc

Or, would the Pet Treatment only arise from an examination, and therefore simply be a bunch of relationship attributes?
Reply With Quote
  #4 (permalink)  
Old 10-29-10, 08:16
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
you definitely need something to record a pet treatment, so i guess that would ~have~ to be an entity

and while many of its attributes will be relationship attributes, some of them will be unique to each specific incidence
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #5 (permalink)  
Old 10-29-10, 09:45
ftl25 ftl25 is offline
Registered User
 
Join Date: Oct 2010
Posts: 8
So, anything unique to this specific incidence should be contained within the Pet Treatment entity, and others should be relationship attributes?
E.g., could quantity of each type of treatment be a relationship attribute for the invoice -- Pet Treatment relationship?
The deeper I delve into this the more confused I seem to get
Reply With Quote
  #6 (permalink)  
Old 10-29-10, 12:46
ftl25 ftl25 is offline
Registered User
 
Join Date: Oct 2010
Posts: 8
On second thought, it seems to make more sense that something unique to a specific incidence should be recorded as a relationship attribute, and common items should be entities?

Could anyone clear up the confusion for me?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On