Results 1 to 6 of 6
  1. #1
    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.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by ftl25 View Post
    I am confused however about "Type of Treatment". Could this be another entity?
    you betcha
    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
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    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?

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    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
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    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

  6. #6
    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •