Modelling the system

Conceptual modelGood database design requires the designer to identify exactly what the database is to be used for. A well designed database provides a base for good data management and delivers accurate information.

This topic highlights:

  • Why design databases? - problems in badly designed databases
  • Levels of modelling - steps involved in good database design -
  • Gathering system information - understanding the system to be modelled

Why design databases?


Ch4 pp 196-197

Poor database design gives rise to what is known as anomalies. To avoid the problems associated with poor database design, it is important that you understand what anomalies are. This reading from your textbook gives an overview of anomalies.

Have a go

Once you have completed the interactive exercise, read the summary opposite which identifies three types of anomalies possible in poorly design databases

Remember
Poorly designed databases duplicate data and this causes anomolies.
A database should never duplicate data.

To avoid all of these problems of data redundancy we need to take a close look at the next section, which will give us the tools to build functional databases.

 

Levels of modelling

In order to achieve a functional database we use models to represent the system we are analysing. The approach that designers use is detailed in the next short, interactive reading.

From the reading it is important that you understand the difference between the conceptual model, logical and physical models and how they come together.

 

Gathering system information

The conceptual model relies heavily on the business rules that are garnered from the client organisation. This is where communication skills will be invaluable.

Remember
In the real world, your clients won't generally lie to you, but they will never tell you the whole story and they will always change their minds.
If you don't know the client's requirements and business rules, you can't design the database.

Gathering business rules may take weeks and numerous interviews to complete.


Ch2 pp 94-100

Work your way through the textbook reading on Modelling the rules of the organisation. Don't worry about the references to chapters 1 & 2.

Some important points from this reading include:

  • Scope of Business Rules: It is important that you understand the scope
    of the business rules you are gathering. You don't model anything but
    the system in question.
  • Data Names: Note the six points that go into making a good data name.
  • Data Definitions: Particularly important in describing how a derived
    attribute is calculated.

Have a go: Primary Keys

 

Getting your hands dirty

Discount warehouseHonest Bob's Discount Warehouse

Identify the business rules that are pertinent to an invoice database below.

To do this:

  1. Roll your cursor over the scenario to identify the section of the text you think would become a rule.
  2. Click the text and write your rule.
  3. Check answers.
  4. Hint: there are 5 rules to be found

Scenario

Honest Bob's Discount Warehouse of 23 Dubious Lane Cheapside NT 8023 needs a computerised invoicing system. Because Honest Bob is a cheapskate they are still using a paper-based system.

The organisation has a number of customers, which are all businesses (Honest Bob's does not deal with the general public, which avoids all the problems with GST). Information kept on customers includes their ABN (CustABN), business name and address (which includes the address, suburb, state and postcode). Because Honest Bob's is keen on keeping their customers and having them return time after time, the prices there are suspiciously cheap.

When a customer purchases products they are given an invoice that lists the items purchased. Generally customers purchase a number of different items of varying quantities each time. If a customer decides that they haven't got enough of a particular item, instead of increasing the quantity for that item, Honest Bob's staff just add it again to the bottom of the invoice and give the new, updated copy to the customer.

Details on the invoice include the customer details, an invoice number, a date, an item number, its description, price, quantity ordered, subtotals for each item line and an invoice total.

View all rules for invoices. View the answer

Rule 1: A customer can receive many invoices
Rule 2: Each invoice is for one customer only
Rule 3: An invoice can contain more than one item
Rule 4: An item can appear on many invoices
Rule 5: An item can appear on an invoice more than once

Company projects

Identify the business rules that are pertinent to a company projects database below.

To do this:

  1. Roll your cursor over the scenario to identify the section of the text you think would become a rule.
  2. Click the text and write your rule.
  3. Check answers.
  4. Hint: there are 3 rules to be found

Scenario

A company has a number of employees. The attributes of employee include employee_id (identifier), name, address, and birthdate. The company also has several projects. attributes of project include project_id (identifier), project_name, and start_date. Each employee may be assigned to one or more projects, or may not be assigned to a project. A project must have at least one employee assigned and may have any number of employees assigned. An employee's billing rate may vary by project, and the company wishes to record the applicable billing rate (billing_rate) for each employee when assigned to a particular project.

View all rules for company projects.View the answer

Rule 1: An employee can be assigned to many projects
Rule 2: A project can have many employees
Rule 3: An employee's billing rate can vary for each project

Grade report

Identify the business rules that are pertinent to an grade report database below.

To do this:

  1. Roll your cursor over the scenario to identify the section of the text you think would become a rule.
  2. Click the text and write your rule.
  3. Check answers.
  4. Hint: there are 5 rules to be found

Scenario

From the sample grade report below, what business rules can you deduce? Assume that each course is taught by one instructor.

MILLENIUM COLLEGE
GRADE REPORT
FALL SEMESTER 200X

  NAME: Emily Williams ID: 268300458  
  CAMPUS ADDRESS: 208 Brooks Hall    
  MAJOR: Information Systems    
         
COURSE TITLE INSTRUCTOR NAME INSTRUCTOR LOCATION GRADE

IS350 Database Mgt Codd B104 A
IS465 System Analysis Parsons B317 B

 

Based on your current enrolment, what other assumptions can be made?

View all rules for grade reports.View the answer

Rule 1: A student can enrol in many courses (units)
Rule 2: A student receives a grade for each course
Rule 3: A course is taught by only one instructor
Rule 4: A course can have many students
Rule 5: An instructor can teach many courses

Remember
Business rules may not be readily apparent when working with an organisation's documents, but, it is always useful to have access to them.

 

Real estate firm

Identify the business rules that are pertinent to an real estate database below.

To do this:

  1. Roll your cursor over the scenario to identify the section of the text you think would become a rule.
  2. Click the text and write your rule.
  3. Check answers.
  4. Hint: there are 9 rules to be found

Scenario

View all rules for real estate.View the answer

Rule 1: A sales office has many employees
Rule 2: An employee is assigned to one sales office
Rule 3: A sales office has one employee who is a manager
Rule 4: A manager must be an employee assigned to a sales office
Rule 5: A sales office has many properties listed
Rule 6: A property is only listed with one sales office
Rule 7: A property can have many owners
Rule 8: An owner can own many properties
Rule 9: Each owner owns a percentage of a property

Courts

Identify the business rules that are pertinent to a courts database below.

To do this:

  1. Roll your cursor over the scenario to identify the section of the text you think would become a rule.
  2. Click the text and write your rule.
  3. Check answers.
  4. Hint: there are 8 rules to be found

Scenario

View all rules for courts.View the answer

Rule 1: An attorney can have many clients for a case
Rule 2: A client can have many attorneys for a case
Rule 3: A client can have many cases
Rule 4: An attorney can have many cases
Rule 5: A case is assigned to one court
Rule 6: (Implied) A court can have many cases
Rule 7: A court can have many judges
Rule 8: A judge is appointed to one court