Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

ACF5904

Tutorial 3 – Mapping data in a process

OVERVIEW

In the opening lecture we emphasised the key role the AIS plays in capturing, storing, processing, and manipulating data in order to support business needs and decision making. A key question that underlies this understanding of AIS is how   the business decides on what data to collect and how it is to be managed.

This raises the important area of data modelling, which is concerned with providing a blueprint for how data collected,

aggregated, and communicated across the business processes. Our focus this week concerns the techniques used to

carry out data modelling, with the Unified Modelling Language for standard class diagrams ('UML') approach being used.

The data modelling process requires the answering of key questions, including

.       What are the things (people, events, resources etc) that we need to keep data about?

.       What are the relationships / connections that exist between these different things?

.       What are the key business rules that shape the answers to the above questions?

.       How can these things and their relationships be implemented in a database?

We will look at how these questions are answered and the implications of different business rules and process designs for how data is modelled.

 REFERENCES

.       Richardson et al (2021) – Chapter 4

区 OBJECTIVES

By the end of this tutorial you should be able to:

.        Identify classes and associations

.        Interpret multiplicities

.       Prepare a class diagram

.       Describe the role and characteristics of a primary key

.        Identify and distinguish between primary and foreign keys

.        Describe the relationship between business rules and structure models

.       Compare class models and identify their different underlying business rules

.       Analyse a process and identify the related decisions and business rules

 KEY CONCEPTS

Chapter 3

Association / relationship, attributes, business rule, cardinalities / multiplicities, class, class diagram, data model, entities, foreign key, primary key, structure model

Chapter 4

Data dictionary, database, database management system, entity integrity rule, query, referential integrity rule, relational data model, Structured Query Language (SQL)

o SELF TEST MULTIPLE CHOICE

The following questions are set to reinforce some of the key ideas from chapter 1. These will not necessarily be directly   covered in the TASK 1 –MULTIPLE CHOICE (These are set up as a Moodle Quiz and may not be covered in class)

1.

STUDENT

0..*

0..*

SUBJECT

 

 

Based on the diagram, which of the following is FALSE:

a.  A student is only allowed to complete one subject

b.  A subject can be listed even if it has no students

c.   A student can be recorded even if they have not chosen a subject

d.  Subjects can have many students enrolled

2.

INVENTORY

1..*

0..1

SALE

 

 

Based on the diagram, which of the following is correct:

a.  A sale can only involve one item of inventory

b. A sale can occur with no inventory items involved

c. An item of inventory can appear in many sales transactions

d. An inventory item can be recorded even if it is unsold

Questions 3, 4 and 5 refer to the class diagram below.

SALE

1..*

1..1

CUSTOMER

 

 

3. Based on the diagram above, which of the following best describes the business rule in place: a. A sale can involve many customers

b. A sale can occur without recording a customer

c. A customer is only recorded when they are involved in a sale

d. Customers can be recorded without having been involved in a sale

4. Based on the diagram, the relationship between SALE and CUSTOMER is:

a. one-to-one

b. many-to-one

c. many-to-many

d. Optional

5. Based on the diagram, a sale:

a. involves one or more customers

b. involves one customer only

c. can be made without a customer

d. must include inventory

Questions 6 and 7 refer to the class diagram below.

1..1 

0..*

Sales

0..*

1..1 

6. If the class diagram above was to be built in an Access database, how many tables would need to be created? a. 3

b. 4

c. 5

d. 6

7. If we focus on the Customer-Sales relationship, which table would hold the primary key for the customer? a. Customer because customer primary key is the unique identifier for customers

b. Sales because we need to know the customers involved in a sale

c. Both sales and customers would have a primary key for customer

d. Customer because we need to know the sales staff they are working with

Questions 8, 9, 10, 11 refer to the following data tables from an organisation’s database.

SALES

Sale No

Customer ID

Sales Date

Amount

S1054

CUST101

10/8/2020

$45.58

S1055

CUST108

10/8/2020

$67.22

S1056

CUST103

10/8/2020

$12.78

S1057

CUST101

10/8/2020

$19.63

S1058

CUST102

10/8/2020

$37.41

S1059

CUST104

10/8/2020

$15.22

8. How many attributes are there in the SALES table?

a. 2

b. 3

c. 4

d. 6

9. How many instances are there in the CUSTOMERS table?

a. 3

b. 4

c. 5

d. 6

CUSTOMERS

Customer ID

Name

Customer Type

CUST101

Meya Kildor

Premium

CUST102

Henry Globe

Standard

CUST103

Adrian Andrews

Standard

CUST104

Rosie Wilkins

Premium

10. Based on the two tables provided, which attribute in the SALES table is an example of a FOREIGN KEY?

a. Sale Date

b. Amount

c. Sales No

d. Customer ID

11. Which transaction in the SALES table violates referential integrity?

a. Sale No S1054

b. Sale No S1055

c. Sale No S1056

d. Sale No S1057

12. Which of the following is NOT a trait of a primary key

a. Cannot be null

b. Non-repeating

c. Changes over time

d. Controlled by issuing organisation

a DISCUSSION QUESTIONS

1 - DQ 1 – p.86 – Based on the sales and cash receipt classes shown in the diagram below, answer the questions that follow.

SALE

1..1

0..1

CASH RECEIPT

 

 

a)    What is the relationship between sales and cash receipts (1-to-1, 1-to-many, many-to-many)? (Remember the

relationship is determined by taking the maximum side of both of the multiplicities)

b)    Describe what the multiplicities tell us about the relationship between sales and cash receipts c)    What kind of business is this (in terms of payment requirements from customers)?

d)    How would the diagram change if, for example, it was a used car dealer that accepted multiple payments from customers over time?

2 - Compare the two class diagrams below.

SALE

1..*

1..1

CUSTOMER

 

 

Diagram A

SALE

0..*

1..1

CUSTOMER

 

 

Diagram B

a)    Briefly explain the relationship and multiplicities for each diagram

b)    What is the difference between Diagram A and Diagram B when it comes to recording a customer in the system?

c)    What types of businesses do you think would use Diagram A as a model? Provide an example and explain why. d)    What types of businesses do you think would use Diagram B as a model? Provide an example and explain why.

3 – What is meant by the term REFERENTIAL INTEGRITY? Briefly explain why it is important in order for a relational database to operate correctly.

 CLASS DIAGRAM PREPARATION

Problem 1 – Page 86 (modified)

Dr Franklin runs a small medical clinic specializing in family practice. There are two doctors, Dr Franklin and Dr Scott.

The practice has many patients and patients can see any doctor they like. When the patients visit the clinic, the doctor may perform several tests to diagnose their conditions. Patients are billed one amount for the visit (this is based on

whether it is a short or long consultation) plus any additional amounts for each test performed. Patients must pay the full amount owed for the consultation and treatment within 30 days of the visit to the clinic.

a)    Identify the classes needed to build a database for Dr Franklin’s practice

b)    Identify the associations between the classes

c)    Prepare a class diagram that includes associations and multiplicities

d)    For the class diagram you have prepared, suggest the attributes that could be included in each class. Clearly identify any primary and foreign keys.

e)    Specify any assumptions you have made about the business rules for Dr Franklin and how they impact your diagram.

 CASE ANALYSIS AND UML CLASS DIAGRAM PREPARATION

Authentic Antiques is a furniture store that sells old and rare furniture. Its products for sale are all unique items and are acquired through the personal network of the business owner, Julian Flaccus. At present, Julian operates the business using a traditional, paper-based accounting system. However, he is keen to implement a database that can help him

better capture the business’s activities and financial events. Julian has asked you to prepare a plan for a database that could be built in Microsoft Access. You agree to help Julian. To get an understanding of the business, you have a

meeting with Julian and get the following information about how the business operates.

.       The items for sale are unique and one of a kind

.       Customers can pay the full amount of the purchase up front, or they can pay a 10% deposit and pay the remaining amount back in monthly instalments over two years

.       Julian has three casual staff who help with sales and one staff member who handles the cash and does the

accounting for the business. He is keen to know the activity of each employee and wants a system that will

allow him to potentially award a sales commission bonus payment to staff who have a strong sales performance

.       Employees are classified as either Sales or Admin

.       The business has three bank accounts (investment, payroll, and operations). The operations account is used to do the daily banking. All cash payments received in the store during daily trading are deposited in the

operations bank account at the end of the day.

.       Julian wants to be able to link customer payments to the specific sale they relate to (e.g. track each instalment payment to the sale transaction)

.       Julian has a business policy that the sales price for an item cannot be lower than the cost price plus 15%

.       Julian has a small but loyal customer base. All of the customers he keeps records for have purchased from his store and he does not keep a customer profile unless they have purchased from his store. He only adds new    customers to his records once it is confirmed they are making a purchase.

.       Some customers will purchase more than one item in a sale transaction

.       Some customers will require assistance with delivery of large and bulky items. Julian offers a delivery service based on how far the customer is from the store

REQUIRED:

a)    Identify the CLASSES that would be included in a sales database for Authentic Antiques

b)    Prepare an initial UML class diagram that shows the classes you identified in part (a) and the relationships between the classes

c)    Add the MULTIPLICITIES to the UML class diagram

d)    Julian mentioned a range of ATTRIBUTES that he would like to be recorded in the database. These are listed below. Use the table on the following page to place each attribute in the relevant class (using the classes you  identified in part (a). Where appropriate clearly indicate which item is a PRIMARY KEY. If no primary key is

listed below then specify one that you think would be appropriate.

Customer ID

Employee type

Sale total

Employee first name

Sale date

Sale price

Employee last name

Customer name

Inventory acquisition date

Inventory number

Inventory description

Customer title

Bank account number

Cash receipt number

Customer distance from store (km)

Inventory Cost price

Cash receipt date

Sale delivery fee

Bank Account name

Customer street address

Customer postcode

Customer Phone Number

Customer suburb

 

Employee hire date

Sale number

 

e)    Based on the multiplicities and relationships you have identified, add the necessary FOREIGN KEYS to your classes, so that the relationship between the classes can be built in Microsoft Access.

f)     When discussing primary key selection with Jordan, he suggests that the business could use a customer’s phone number as a primary key. Use the characteristics of a primary key to explain why this is not a good  strategy.

A table is provided on the following page to help you structure your answer to parts (d) and (e).

Remember:

A CLASS / ENTITY is something about which data is kept

An ATTRIBUTE is something that describes an instance of a class

A MULTIPLICITY describes the relationship between classes

A PRIMARY KEY is a unique identifier

A FOREIGN KEY allows for the logical connection between classes to occur