1. DATA MODELLING
• Part of a DFD is a data store, but we did not
say very much about these.
• They are equivalent to files or databases, but
we did not look at how the data is structured.
That is the subject of this unit. Data modelling,
or entity modelling, is about entities and how
they are related. The diagram which is used to
show these relationships is called, naturally
enough, the entity-relationship diagram or E-R
diagram for short.
2. ENTITIES, ATTRIBUTES AND
RELATIONSHIPS
• An entity is a thing of interest about which data is
kept. Therefore, for example:
– in a sales order processing system, a CUSTOMER would
be an entity
– in a library system, a BOOK would be an entity
– in a hospital system, a PATIENT would be an entity.
• Entities are often equivalent to files in a computer
system, so you would expect a Customer file, a
Book file and a Patient file. The data kept about an
entity make up the attributes of that entity.
3. Entity - Attributes
An attribute is an item of data held about an entity. Using our examples from
above:
– for a customer, some attributes would be customer name, customer address, credit
limit
– for a book, some attributes would be title, author, publisher, ISBN
– for a patient, some attributes would be name, address, doctor.
• However, each individual customer, patient and book needs to be identified
uniquely. So it is normal to have one (or more) special attributes which can be
used as an identifier. This is the key attribute and it often has to be made up
specially.
A key attribute uniquely identifies a specific occurrence of an entity. Codes and
numbers are often used for these key attributes, since they themselves can also be
unique. Again using the examples from above, the unique identifier (or, simply, the
"key") may be Customer Code, Patient Number and ISBN. When the attributes of an
entity are listed, the key attribute is usually highlighted in bold or underlined as
below:
Entity Attributes
CUSTOMER Customer Code, customer name, customer address, credit limit
BOOK ISBN, title, author, publisher
PATIENT Patient Number, patient name, patient address, doctor
4. Activity 1
The following describes some of the procedures involved in a
direct line car insurance company.
A potential customer telephones the company and gives
details of the vehicle to be insured. This results in a quotation
that remains on file for one month. If the customer accepts the
quotation within one month it becomes a policy. If an accident
occurs the customer contacts the company who send out a
claim form. The customer completes the claim form, sends it
back to the company who then files it as a claim.
The following nouns or compound nouns are present in the
above description: Customer, company, details, vehicle,
quotation, file, month, policy, accident, claim form, claim.
Which of the above are likely to be entities?
5. ENTITY RELATIONSHIPS
• Entities are related to each other and an E-R
diagram for a system shows all the entities
and all the relationships between these
entities. Consider the following scenarios.
• Read further on data modeling