The pet owner is responsible for the cost of the treatment given to a pet. The owner is invoiced for the treatment arising from each examination, and the details recorded on the invoice include the invoice number, invoice date, owner number, owner name and full address, pet number, pet name, and the details of the treatment given. The invoice provides the cost for each type of treatment and the total cost of all treatments given to the pet. Additional data is also recorded on the payment of the
invoice, including the date the invoice was paid and the method of payment (for example, check, cash, visa). The invoice number is unique throughout the practice.
From this I have deduced that there are two entities; the invoice and the payment of the invoice. Can anyone advise me if this is correct?
Also this paragraph:
Each clinic also maintains a stock of pharmaceutical supplies (for example, antibiotics, pain killers). The details of pharmaceutical supplies include a drug number and name, description, dosage, method of administration, quantity in stock (this is ascertained on the last day of each month), reorder level, reorder quantity, and cost. The drug number uniquely identifies each type of pharmaceutical supply. The drug number is unique for each pharmaceutical supply and used throughout the practice.
From this I have deduced that there are two entities; the pharmaceutical supplies, and the order. Or could the maintenance of pharmaceutical supplies simply depend on the reorder level as a relationship attribute?
Yes that sort of thing. You are still missing a further entity from that first sentence. You are focusing immediately on the complex entities when there are some really rudimentary entities to consider.
The second is still not there but you are closer. Concentrate on one thing at a time - they are not really dependent on each other.
I think I know what you mean from the first paragraph - there is the Treatment entity? I have a large piece of text to go through to model the ER diagram. I think I have all the major entities, and I am left with some of the more complex ones to work out.
So, for the second part:
A Clinic -- maintains -- Pharmaceutical Supplies depending on the reorder level on the last day of the month? (relationship attributes = reorder level, date?)
Pharmaceutical Supplies is an entity with all the drug details
Order is another entity with reorder level, reorder quantity, cost?
The more obvious ones are fine for me, but I find some of the more complex ones confusing.
The only requirement here is that you do your own homework. We nudge and hint, but we don't do it for you. You are not like this, but a lot demand there homework be completed for them, and so there are a lot of jaded souls on the forums.
Originally Posted by ftl25
The more obvious ones are fine for me
There's still an absolutely blindingly obvious one yet to be mentioned. However, this entity will become apparent as you move through normalisation (3rd normal form specifically).
It's probably time to start building your diagram. The process of normalisation will help solidify a lot of this for you.
Yes, Examination? What I'm really trying to find out is if there any definite way (or good indicator) to tell if something should be an entity or simply some part of a relationship?
I know some rules - like an entity should exist on its own and should be thought of as an object - but again - in my mind I can apply this to some descriptions, but also think that the description is of a relationship, and this is where the line blurs for me.
I have started with the diagram, and I have something like 11 entities already with many of the relationships already implemented.
Work through the normalisation process. Normalisation typically results in decomposition of entities. I think it would actually be a good thing not to identify the entity now and find it via normalisation.