2011 sp2 - swinburne cis211 - assessment 1
TRANSCRIPT
Individual Assignment Coversheet (Online version)
Individual Assignment Coversheet as of Nov 2009.doc
DETAILS OF ASSIGNMENT
STUDENT NAME Andrew Edward COLE ID NUMBER 7208383
EMAIL ADDRESS [email protected] PHONE CONTACT +61 407 384 998
UNIT CODE * NAME CIS211 – Database Concepts and Modelling
ASSESSMENT TITLE Assessment One – Conceptual and Logical Database Design
DUE DATE No later than Sunday 10th July, 2011 @ 11:59pm AEST
GRADE LEVEL ATTEMPTED: Distinction WEIGHTING: 20%
.
DECLARATION
I hold a copy of this assignment that can be produced if the original is lost/damaged. To the best of my belief, no part of this assignment has been copied from any other student’s work or from any other source except where due acknowledgement is made in the text. No part has been written for me/us by any other person, except where such collaboration has been authorised by the lecturer concerned.
Student acknowledgement ( by typing your name you agree to the above):
Andrew Edward COLE
Date:
10/07/2011
DETAILS OF FEEDBACK
Office Use Only
Date Received Received by
Total Mark / Grade Marker
Individual Assignment Coversheet as of Nov 2009.doc
A proposed Relational Database Schema to
support Aussie Fried Duck’s new Store
Management System
Store
Management
System
Prepared for
Aussie Fried Duck Andrew E. Cole 7208383 – CIS211 – July 2011
Andrew Cole i
CIS211 7208383 July 2011
Executive Summary
This report presents a design for a Relational Database Management System schema for use in Aussie
Fried Duck’s proposed Store Management System.
The business rules to be considered in the design of such a system are outlined, and a conceptual
Entity Relationship Diagram is presented. A logical design and normalization process is then completed
on the conceptual design, resulting in a Relational Entity Relationship Diagram.
Sample data showing the usability and flexibility of the proposed system is also presented.
Andrew Cole iii
CIS211 7208383 July 2011
Table of Contents
Executive Summary ..............................................................................................................................i Table of Contents ................................................................................................................................ iii Table of Figures ................................................................................................................................... v
Table of Tables .................................................................................................................................... v 1. Introduction ...................................................................................................................................... 1 1.1. Aussie Fried Duck ........................................................................................................................ 1 1.2. Store Management System .......................................................................................................... 1 1.3. Relational Database ..................................................................................................................... 1 1.4. Out of Scope ................................................................................................................................. 2
2. Project Description .......................................................................................................................... 3 2.1. Customer ...................................................................................................................................... 3
2.2. Call ............................................................................................................................................... 3 2.3. Order ............................................................................................................................................ 4
2.4. Store ............................................................................................................................................. 5 2.5. Products ....................................................................................................................................... 6 2.6. Menu ............................................................................................................................................ 6
2.7. Payment ....................................................................................................................................... 7 3. Logical Design ................................................................................................................................. 8 3.1. Multi-Valued Attributes.................................................................................................................. 8 3.2. Composite Attribute ...................................................................................................................... 9 3.3. Many-Many Relationships ............................................................................................................ 9
4. Normalization .................................................................................................................................. 10 4.1. Conversion to First Normal Form ................................................................................................. 10
4.2. Conversion to Second Normal Form ............................................................................................ 10 4.3. Conversion to Third Normal Form ............................................................................................... 10
5. Conclusion ...................................................................................................................................... 11 6. Recommendations .......................................................................................................................... 11 7. References ..................................................................................................................................... 12
Appendix A. Conceptual Entity Relationship Model ............................................................................ 13 Appendix B. Relational Entity Relationship Model .............................................................................. 14 Appendix C. Relational Database Schema ......................................................................................... 15 C.1. Customer .................................................................................................................................... 15 C.2. Order ........................................................................................................................................... 16 C.3. Store ........................................................................................................................................... 16 C.4. Product........................................................................................................................................ 17 C.5. MealDeal ..................................................................................................................................... 17 C.6. PhoneOrder ................................................................................................................................ 17
C.7. InternetOrder ............................................................................................................................... 18 C.8. StoreOrder .................................................................................................................................. 18
C.9. Call .............................................................................................................................................. 18 C.10. Menu ......................................................................................................................................... 19 C.11. Payment .................................................................................................................................... 19 C.12. CustomerPhone ........................................................................................................................ 19 C.13. MenuContainsProduct ............................................................................................................... 20
Andrew Cole iv
CIS211 7208383 July 2011
C.14. MenuFeaturesProduct .............................................................................................................. 20 C.15. OrderConsistsOfProduct........................................................................................................... 20 C.16. MealDealConsistsOfProduct ..................................................................................................... 21 Appendix D. Sample Data .................................................................................................................. 22
D.1. Customer .................................................................................................................................... 22 D.2. Order .......................................................................................................................................... 24 D.3. Store ........................................................................................................................................... 25 D.4. Product ....................................................................................................................................... 25 D.5. MealDeal .................................................................................................................................... 27
D.6. PhoneOrder ................................................................................................................................ 27 D.7. InternetOrder .............................................................................................................................. 28 D.8. StoreOrder .................................................................................................................................. 28
D.9. Call ............................................................................................................................................. 28 D.10. Menu ........................................................................................................................................ 29 D.11. Payment ................................................................................................................................... 29 D.12. CustomerPhone ........................................................................................................................ 30
D.13. MenuContainsProduct .............................................................................................................. 31 D.14. MenuFeaturesProduct .............................................................................................................. 32 D.15. OrderConsistsOfProduct........................................................................................................... 32
D.16. MealDealConsistsOfProduct ..................................................................................................... 33
Andrew Cole v
CIS211 7208383 July 2011
Table of Figures
Figure 1 - Product Table in 3NF ............................................................................................................ 10 Figure 2 - Conceptual Entity Relationship Model .................................................................................. 13 Figure 3 - Relational Entity Relationship Model ..................................................................................... 14
Table of Tables
Table 1 - Customer Table Schema ....................................................................................................... 15
Table 2 - Order Table Sample Data ...................................................................................................... 16 Table 3 - Store Table Schema .............................................................................................................. 16
Table 4 - Product Table Schema ........................................................................................................... 17
Table 5 - MealDeal Table Schema ........................................................................................................ 17 Table 6 - PhoneOrder Table Schema ................................................................................................... 17 Table 7 - InternetOrder Table Schema .................................................................................................. 18 Table 8 - StoreOrder Table Schema ..................................................................................................... 18
Table 9 - Call Table Schema ................................................................................................................. 18 Table 10 - Menu Table Schema ............................................................................................................ 19 Table 11 - Payment Table Schema ....................................................................................................... 19
Table 12 - CustomerPhone Table Schema ........................................................................................... 19 Table 13 - MenuContainsProduct Table Schema .................................................................................. 20 Table 14 - MenuFeaturesProduct Table Schema .................................................................................. 20 Table 15 - OrderConsistsOfProduct Table Schema .............................................................................. 20
Table 16 - MealDealConsistsOfProduct Table Schema ........................................................................ 21
Table 17 - Customer Table Sample Data .............................................................................................. 22 Table 19 - Order Table Sample Data .................................................................................................... 24 Table 20 - Store Table Sample Data ..................................................................................................... 25
Table 21 - Product Table Sample Data ................................................................................................. 27 Table 22 - MealDeal Table Sample Data .............................................................................................. 27
Table 23 - PhoneOrder Table Sample Data .......................................................................................... 27 Table 24 - InternetOrder Table Sample Data ........................................................................................ 28 Table 25 - StoreOrder Table Sample Data ............................................................................................ 28
Table 26 - Call Table Sample Data ....................................................................................................... 28 Table 27 - Menu Table Sample Data .................................................................................................... 29 Table 28 - Payment Table Sample Data ............................................................................................... 29
Table 29 - CustomerPhone Table Sample Data .................................................................................... 30 Table 30 - MenuContainsProduct Table Sample Data .......................................................................... 32 Table 31 - MenuFeaturesProduct Table Sample Data .......................................................................... 32 Table 32 - OrderConsistsOfProduct Table Sample Data....................................................................... 33
Table 33 - MealDealConsistsOfProduct Table Sample Data ................................................................. 34
Andrew Cole 1
CIS211 7208383 July 2011
1. Introduction
1.1. Aussie Fried Duck
Aussie Fried Duck (AFD) is a chain of fast food stores selling a range of fried duck meals. Currently
AFD only offers in-store purchases with a manual ordering process.
1.2. Store Management System
In response to the increased prevalence of fast food stores offering delivery and takeaway ordering via
the internet, AFD has made the decision to allow ordering via the internet and phone.
In order to efficiently manage the order taking process, and potentially introduce efficiencies in other
processes, AFD have called for proposals to develop a new Store Management System (SMS).
AFD requires the developed system to:
a. Accept home delivery orders by phone or internet;
b. Automate order taking and cooking cycles in their stores; and
c. Allow managers to order supplies online from a centralised AFD warehouse.
1.3. Relational Database
A Relational Database Management System (RDBMS) is proposed to provide the back-end for the
SMS.
A DBMS provides many advantages over AFD’s current paper-based system, including data sharing
between multiple applications, improved security (both from information theft and inadvertent data
loss), and improved access to data (Rob & Coronel 2009, p. 8). It is hoped that these advantages will
improve productivity at AFD.
Andrew Cole 2
CIS211 7208383 July 2011
1.4. Out of Scope
As this document is concerned with the development of the RDBMS schema, interactions with external
systems are out of scope. These include, but are not limited to:
Credit Card system;
EFTPOS Card system;
Web site;
Phone system;
Various displays used by staff, both in-store and delivery.
Andrew Cole 3
CIS211 7208383 July 2011
2. Project Description
Each entity involved in the SMS is represented in the RDBMS as a table. Each entity has a set of
attributes.
The following business rules have been considered when developing the RDBMS schema for the SMS.
Appendix A presents a conceptual Entity-Relationship diagram for the developed schema.
2.1. Customer
The Customer entity represents a single customer of AFD. The following business rules were
considered while developing this entity:
Each customer is assigned a unique customer number (CustomerID);
Each customer’s first (FirstName) and last (LastName) name is stored;
Each customer’s home address (Address) is stored; and
Each customer has zero or many orders (CustomerPlacesOrder).
The Address attribute is not required (can be null), but is filled automatically with the delivery address
used for the customer’s first delivery order. This address is then used as the default delivery address in
any further delivery orders, unless the customer requests a permanent change.
2.2. Call
The Call entity represents a call made to AFD’s nationwide 1300 number. The following business rules
were considered while developing this entity:
Each call is given a unique call number (CallID);
The date and time of each call being received by the SMS is recorded (DateTime);
The amount of time the call was placed on hold before being answered is recorded
(OnHoldDuration);
The amount of time taken by the sales associate on the call is recorded (WithAgentDuration);
The store the call was directed to is recorded (CallDirectedToStore), with each call being
directed to exactly one store; and
Andrew Cole 4
CIS211 7208383 July 2011
Any order resulting from the call is recorded (OrderFromCall), with each call resulting in one or
no orders.
The unique call number is required as there is a possibility of two unique calls coming in at exactly the
same moment, with the same duration, to the same store, meaning there is no naturally occurring
unique identifier for this entity.
If a call is abandoned by the customer before being answered by a sales associate, the
WithAgentDuration attribute is set to 0. This allows reporting on the number of abandoned calls.
The number the call is from is not recorded in the Call entity. The number is used to prepopulate a
PhoneOrder instance for the sales associate by querying on the phone numbers in the Customer
entity. If no Customer entity with the required number is present a new Customer entity is created.
If a call does not result in an order (perhaps the customer was enquiring about opening hours or an
earlier order), the OrderFromCall relationship is not created.
2.3. Order
The Order entity represents a single order placed at an AFD store, whether it is via phone, the Internet
or in store. Each different order source is represented by a sub-entity.
The following business rules were considered while developing the Order entity:
Each order is assigned a unique number (OrderID);
Each order is made by exactly one customer (CustomerPlacesOrder);
Each order is placed at exactly one store (OrderPlacedAtStore);
Each order consists of one or more Products (OrderConsistsOfProduct);
The requested delivery address is recorded (DeliveryAddress);
Each order can have zero or more payments (PaymentReceivedForOrder); and
The total cost of each order is recorded (OrderTotal).
The unique order number is not required by the database schema, as a composite key consisting of
several foreign keys could be used as a primary key instead. OrderID is populated as a convenience
for sales associates and delivery drivers, ensuring an order is easily identifiable.
Andrew Cole 5
CIS211 7208383 July 2011
If the order is for pickup, the DeliveryAddress attribute is set to null.
The total cost of the order is recorded to protect against prices of products changing in the future. The
amount owing is not recorded; this can be calculated by totalling the associated Payment entities and
subtracting from the OrderTotal attribute.
Orders placed via telephone are represented by the PhoneOrder sub-entity. The following business
rules were considered while developing this sub-entity:
Each phone order is a result of exactly one phone call (OrderFromCall).
Orders placed over the Internet are represented by the InternetOrder sub-entity. The following
business rules were considered while developing this sub-entity:
The IP Address of the client placing the Internet order is recorded (IPAddress).
Orders placed in person are represented by the StoreOrder entity. The following business rules were
considered while developing this sub-entity:
The length of time taken by the sales associate to record and submit the order is recorded
(TimeTaken).
2.4. Store
Each AFD store is represented by an instance of the Store entity. The following business rules were
considered while developing this entity:
Each AFD store is identified by a Store ID (StoreID);
The address (StoreAddress) and phone number (StorePhone) are recorded;
Each store is managed by a store manager (Manager);
Each store can have zero or many orders recorded (OrderPlacedAtStore);
Each store has had zero or more calls directed to it (CallDirectedToStore); and
Each store has one or more menus (MenuBelongsToStore);
Andrew Cole 6
CIS211 7208383 July 2011
2.5. Products
AFD offers a wide range of products, each represented by an instance of the Product entity. The
following business rules were considered while developing this entity:
The product name (ProductName) uniquely identifies the product;
The product preparation time (PrepTime), the time it takes to produce a particular item
including cooking/reheating, is recorded;
The product dead time (DeadTime), the time during a product’s preparation when the kitchen
associate is free to work on filling other items, is recorded;
The product description (Description), unit price (Price), and picture (Picture) are recorded;
Each product can be a part of zero or more orders (OrderConsistsOfProduct);
Each product can be a part of zero or more Meal Deals (MealDealConsistsOfProduct), and the
quantity of each product in each Meal Deal is recorded (Quantity);
Each product can feature in zero or more menus (MenuFeaturesProduct); and
Each product can be listed in zero or more menus (MenuContainsProduct).
Meal Deals are represented by the MealDeal entity, a sub-entity of the Product entity. The following
business rules were considered while developing this entity:
Each meal deal consists of one or more Products (MealDealConsistsOfProduct); and
The quantity of each product in each Meal Deal is recorded (Quantity).
2.6. Menu
Each AFD store has one or more menus. Different menus are displayed at different times (Lunch,
Dinner, Breakfast, Public Holidays, etc.). Each menu is represented by the Menu entity. The following
business rules were considered while developing this entity:
Each menu is identified by a Menu ID (MenuID);
Each menu has a description entered by the creator (Description);
Each menu belongs to exactly one store (MenuBelongsToStore);
Each menu has one or more feature products displayed in the larger panels
(MenuFeaturesProduct); and
Andrew Cole 7
CIS211 7208383 July 2011
Each menu has one or more products listed on the standard panels (MenuContainsProduct).
2.7. Payment
Each payment received by a customer is represented by an instance of the Payment entity. The
following business rules were considered while developing this entity:
Each payment is identified by a Payment ID (PaymentID);
Each payment has a type (PaymentType), either Cash (0), EFTPOS (1), or Credit Card (2);
Each payment has an amount (Amount) and date stamp (DateTime) recorded; and
Each payment is associated with exactly one Order (PaymentReceivedForOrder).
Extended details of the payment, such as Credit Card number, EFTPOS account details, are not
recorded due to privacy concerns. Credit Card numbers must be given at every purchase, whether the
order is received online, via phone or in person.
Andrew Cole 8
CIS211 7208383 July 2011
3. Logical Design
The conceptual ER diagram presented in Appendix A, and described in Section 2, adequately
describes the data model; however representing it in a RDBMS schema presents several problems.
The process of logical design converts a conceptual ER diagram into a relational ER diagram, and
removes these issues. This section describes some issues with the conceptual ER diagram and how
the process of logical design resolved these issues.
3.1. Multi-Valued Attributes
Multi-Valued attributes “refer to the idea that the attribute… has as its value a set” (Mannila & Räihä
1992, p. 77), that is, one attribute can have multiple values. Taking the Phone attribute of the
Customer entity as an example, each customer can have multiple phone numbers. In a conceptual
ERD this is fine, but a RDBMS cannot efficiently store multiple values for one attribute.
One solution to this issue is the creation of multiple attributes, for example, MobilePhone, HomePhone,
and WorkPhone. At first glance this appears to solve the issue; however it introduces a lot of attributes
that may be left null for the majority of entity instances. Also it would not be possible to represent a
Customer with multiple phone numbers of a certain type with such a solution – what if one Customer
had multiple mobiles? An entity with this format would not even be in 1st Normal Form.
The solution used during the logical design here was extracting the Phone attribute into another entity,
CustomerPhone. Each customer is associated with zero or multiple phone numbers
(CustomerHasCustomerPhone), and each phone number is associated with exactly one customer.
Andrew Cole 9
CIS211 7208383 July 2011
3.2. Composite Attribute
A Composite Attribute, also known as a “Struct”, is a “tuple with a fixed number of primitive
components” (Ullman & Widom 2008, p. 127). In other words, a Composite Attribute is an attribute
made up of several other attributes. A composite attribute cannot be directly represented in a RDBMS.
An example of a Composite Attribute that was changed during the logical design process is the
Address attribute in the Customer entity and the DeliveryAddress attribute in the Order entity. The
process of logical design replaced these attributes with AddressStreet, AddressSuburb and
AddressPostCode.
3.3. Many-Many Relationships
A Many-Many Relationship cannot be represented in a RDBMS schema directly. Introduction of an
intermediate table is required.
An example of this is the OrderConsistsOfProduct relationship, where an Order consists of multiple
Products, and a Product can be present in multiple Orders. This is resolved by introducing the
OrderConsistsOfProduct table.
Andrew Cole 10
CIS211 7208383 July 2011
4. Normalization
Normalization is a part of the Logical Design process that aims “to ensure that each table conforms to
the concept of well-formed relations” (Rob & Coronel 2009, p. 157). This section outlines the steps
taken during the normalization of the Product entity. Similar steps were taken for all other entities,
resulting in the Relational ER model presented in Appendix B.
4.1. Conversion to First Normal Form
An entity is in First Normal Form (1NF) when its data is formatted into a table, with no repeating
groups, and the Primary Key (PK) is identified.
The Product table as it stands has no repeating groups, as each row represents a unique item.
Identifying the Primary Key in this table is simple, as the spec states each product is uniquely identified
by its name (ProductName). All other attributes in this table have a dependency on this primary key,
and each primary key uniquely identifies all attributes.
4.2. Conversion to Second Normal Form
An entity is in Second Normal Form (2NF) when the requirements of 1NF are met, and there exist no
partial dependencies. Conversion to 2NF is only required when the 1NF form of the table has a
composite primary key, as such, the table is already in 2NF.
4.3. Conversion to Third Normal Form
An entity is in Third Normal Form (3NF) when the requirements of 2NF are met, and there exist no
transitive dependencies. A transitive dependency is when an attribute depends on one or more non-key
attributes. As no attributes of the Product table depend on any non-key attributes, the table is in 3NF.
Figure 1 presents the Product table schema in 3NF.
Product(ProductName, Price, PrepTime, DeadTime, Description, Picture)
Figure 1 - Product Table in 3NF
Andrew Cole 11
CIS211 7208383 July 2011
5. Conclusion
The use of a RDBMS will contribute greatly towards AFD’s goals in implementing its new SMS. The
consistency, reliability and security of data provided by the presented database schema will make the
introduction of internet and phone ordering to AFD’s stores simple and efficient.
5.1. Recommendations
It is recommended that Aussie Fried Duck implements a Relational Database Management System
(RDBMS) as the back-end for its Store Management System (SMS).
Further investigation into the business rules is also recommended, including:
Clarification of the use of the Menu entity;
Clarification of the Payment recording requirements; and
Integration of the Home Delivery and Supply processes into the SMS.
Development of the SMS should utilise industry best practices, including use of the Systems
Development Lifecycle (SDLC) and Database Lifecycle (DBLC).
Andrew Cole 12
CIS211 7208383 July 2011
6. References
Rob, P & Coronel, C 2009, Database Systems: Design, Implementation, and Management, Eighth
Edition, Course Technology, Boston.
Mannila, H & Räihä, K 1992, The Design of Relational Databases, Addison Wesley, Wokingham.
Ullman, J & Widom, J 2008, A First Course in Database Systems, Third Edition, Pearson, Upper
Saddle River.
Andrew Cole 13 CIS211 7208383 July 2011
Appendix A. Conceptual Entity Relationship Model
Figure 2 presents a Conceptual Entity Relationship Model (E/R Model) for the SMS.
Figure 2 - Conceptual Entity Relationship Model
D
CustomerHasCustomerPhone
CustomerPhone
Number
Quantity
PaymentReceivedForOrder Payment
PaymentID
PaymentType
Amount
DateStamp
MenuContainsProduct
MenuFeaturesProduct
MenuBelongsToStore
Menu
MenuID
Description
CallDirectedToStore OrderFromCall
Call
CallID
DateTime
OnHoldDuration
WithAgentDuration
StoreOrder
TimeTaken
InternetOrder
IPAddress
PhoneOrder
OrderPlacedAtStore
MealDealConsistsOfProduct
OrderConsistsOfProduct
CustomerPlacesOrder
MealDeal
Product
ProductName
Price
PrepTime
DeadTime
Description
Picture
Store
StoreID
StoreAddress
StorePhone
Manager
Order
OrderID
OrderTotal
AddressStreet
AddressSuburb
AddressPostcode
Customer
CustomerID
FirstName
LastName
AddressStreet
AddressSuburb
AddressPostcode
Andrew Cole 14 CIS211 7208383 July 2011
Appendix B. Relational Entity Relationship Model
Figure 3 presents a Relational Entity Relationship Model (E/R Model) for the SMS.
Figure 3 - Relational Entity Relationship Model
D
IsIncludedIn
MealDealConsistsOfProduct
Quantity
IsIncludedIn
OrderConsistsOfProduct
Features
IsContainedIn
MenuFeaturesProduct
MenuContainsProduct
CustomerHasCustomerPhone
CustomerPhone
Number
PaymentReceivedForOrder Payment
PaymentID
PaymentType
Amount
DateStamp
Contains
IsFeaturedIn
MenuBelongsToStore
Menu
MenuID
Description
CallDirectedToStore OrderFromCall
Call
CallID
DateTime
OnHoldDuration
WithAgentDuration
StoreOrder
TimeTaken
InternetOrder
IPAddress
PhoneOrder
OrderPlacedAtStore
ConsistsOf
ConsistsOf
CustomerPlacesOrder
MealDeal
Product
ProductName
Price
PrepTime
DeadTime
Description
Picture
Store
StoreID
StorePhone
Manager
AddressStreet
AddressSuburb
AddressPostcode
Order
OrderID
OrderTotal
AddressStreet
AddressSuburb
AddressPostcode
Customer
CustomerID
FirstName
LastName
AddressStreet
AddressSuburb
AddressPostcode
Andrew Cole 15 CIS211 7208383 July 2011
Appendix C. Relational Database Schema
This section presents the Schema for the RDBMS.
C.1. Customer
Attribute Name Attribute Type Attribute Size Key Information
CustomerID Integer Primary Key
FirstName String 64 Non Key
LastName String 64 Non Key
AddressStreet String 64 Non Key
AddressSuburb String 64 Non Key
AddressPostcode String 4 Non Key
Table 1 - Customer Table Schema
Andrew Cole 16 CIS211 7208383 July 2011
C.2. Order
Attribute Name Attribute Type Attribute Size Key Information
OrderID Integer Primary Key
CustomerID Integer Foreign Key
StoreID Integer Foreign Key
OrderTotal Integer Non Key
AddressStreet String 64 Non Key
AddressSuburb String 64 Non Key
AddressPostcode String 4 Non Key
Table 2 - Order Table Sample Data
C.3. Store
Attribute Name Attribute Type Attribute Size Key Information
StoreID Integer Primary Key
StorePhone String 10 Non Key
Manager String 128 Non Key
AddressStreet String 64 Non Key
AddressSuburb String 64 Non Key
AddressPostcode String 4 Non Key
Table 3 - Store Table Schema
Andrew Cole 17 CIS211 7208383 July 2011
C.4. Product
Attribute Name Attribute Type Attribute Size Key Information
ProductName String 128 Primary Key
Price Integer Non Key
PrepTime Integer Non Key
DeadTime Integer Non Key
Description String 256 Non Key
Picture Binary Non Key
Table 4 - Product Table Schema
C.5. MealDeal
Attribute Name Attribute Type Attribute Size Key Information
ProductName String 128 Primary Key; Foreign Key
Table 5 - MealDeal Table Schema
C.6. PhoneOrder
Attribute Name Attribute Type Attribute Size Key Information
OrderID Integer Primary Key; Foreign Key
CallID Integer Primary Key; Foreign Key
Table 6 - PhoneOrder Table Schema
Andrew Cole 18 CIS211 7208383 July 2011
C.7. InternetOrder
Attribute Name Attribute Type Attribute Size Key Information
OrderID Integer Primary Key; Foreign Key
IPAddress String 15 Non Key
Table 7 - InternetOrder Table Schema
C.8. StoreOrder
Attribute Name Attribute Type Attribute Size Key Information
OrderID Integer Primary Key; Foreign Key
TimeTaken Integer Non Key
Table 8 - StoreOrder Table Schema
C.9. Call
Attribute Name Attribute Type Attribute Size Key Information
CallID Integer Primary Key
StoreID Integer Foreign Key
DateTime DateTime Non Key
OnHoldDuration Integer Non Key
WithAgentDuration Integer Non Key
Table 9 - Call Table Schema
Andrew Cole 19 CIS211 7208383 July 2011
C.10. Menu
Attribute Name Attribute Type Attribute Size Key Information
MenuID Integer Primary Key
StoreID Integer Foreign Key
Description String 256 Non Key
Table 10 - Menu Table Schema
C.11. Payment
Attribute Name Attribute Type Attribute Size Key Information
PaymentID Integer Primary Key
OrderID Integer Foreign Key
PaymentType Integer {0,1,2} Non Key
Amount Integer Non Key
DateStamp DateTime Non Key
Table 11 - Payment Table Schema
C.12. CustomerPhone
Attribute Name Attribute Type Attribute Size Key Information
Number String 10 Primary Key
CustomerID Integer Primary Key; Foreign Key
Table 12 - CustomerPhone Table Schema
Andrew Cole 20 CIS211 7208383 July 2011
C.13. MenuContainsProduct
Attribute Name Attribute Type Attribute Size Key Information
MenuID Integer Primary Key; Foreign Key
ProductName String 128 Primary Key; Foreign Key
Table 13 - MenuContainsProduct Table Schema
C.14. MenuFeaturesProduct
Attribute Name Attribute Type Attribute Size Key Information
MenuID Integer Primary Key; Foreign Key
ProductName String 128 Primary Key; Foreign Key
Table 14 - MenuFeaturesProduct Table Schema
C.15. OrderConsistsOfProduct
Attribute Name Attribute Type Attribute Size Key Information
OrderID Integer Primary Key; Foreign Key
ProductName String 128 Primary Key; Foreign Key
Table 15 - OrderConsistsOfProduct Table Schema
Andrew Cole 21 CIS211 7208383 July 2011
C.16. MealDealConsistsOfProduct
Attribute Name Attribute Type Attribute Size Key Information
MealDealName String 128 Primary Key; Foreign Key
ProductName String 128 Primary Key; Foreign Key
Quantity Integer Non Key
Table 16 - MealDealConsistsOfProduct Table Schema
Andrew Cole 22 CIS211 7208383 July 2011
Appendix D. Sample Data
This section presents some sample data for the SMS database, along with description of what some Entity Instances represent.
D.1. Customer
CustomerID FirstName LastName AddressStreet AddressSuburb AddressPostcode
0 NULL CASH NULL NULL NULL
1 NULL NULL NULL NULL NULL
2 Andrew Cole NULL NULL NULL
3 Barry Brown 1 George Street Devonport 7310
4 Esther Goodal 6 Sunny Bank Drive Nipponville 3251
5 Mitchel Schubert 2/18 Outback Lane NeverNever 4810
6 Albertine Windsor 1 Palace Drive Regal Town 2231
7 Sunny Eggmont 2 Yolk Plains Carton 3105
8 Rocky Sciesmic 77 Fissure Avenue Cavern Town 6666
9 Anna Bunion 33 Ingrown Lane Sole 5423
Table 17 - Customer Table Sample Data
Andrew Cole 23 CIS211 7208383 July 2011
The following is a brief description of what some of the Customer Instances in Table 17 represent:
CustomerID 0 is a Cash customer, used for in-store purchases;
CustomerID 1 is an entity created for an incoming phone call that has not yet been answered by a sales associate, or the associate has not
yet entered further details;
CustomerID 2 is an entity created for an in-store order received via phone; and
CustomerID 3 - 9 are entities created for a delivery orders received via phone or Internet.
Andrew Cole 24 CIS211 7208383 July 2011
D.2. Order
OrderID CustomerID StoreID OrderTotal AddressStreet AddressSuburb AddressPostcode
1 0 1 12.95 NULL NULL NULL
2 3 1 24.95 1 George
Street
Devonport 7310
3 3 2 44.95 12 Watkinson
Street
Devonport 7310
Table 18 - Order Table Sample Data
The following is a brief description of what some of the Order Instances in Table 17 represent:
OrderID 1 is an in-store order at StoreID 1;
OrderID 2 is a phone order at StoreID 1 for delivery to Barry Brown’s default address; and
OrderID 3 is an internet order at StoreID 2 for delivery to Barry Brown at an alternate address.
Andrew Cole 25 CIS211 7208383 July 2011
D.3. Store
StoreID StorePhone Manager AddressStreet AddressSuburb AddressPostcode
1 02 6764 1234 Larry Doodle 5 Scribble Parade Ream 9888
2 03 4875 1124 Louise Knibb 5 Inkstain Cours Biro 8866
Table 19 - Store Table Sample Data
D.4. Product
ProductName Price PrepTime DeadTime Description Picture
All the Way Duck Burger 575 96 32 A burger with traditional duck fillet,
bacon, pineapple, cheese, tomato,
lettuce and mayonnaise
Binary Data
Aussie Duck Nuggets 720 135 45 12 duck nuggets with hoi sin sauce Binary Data
Bacon and Cheese Duck
Burger
545 88 31 A burger with a traditional duck fillet,
bacon, cheese, lettuce and mayonnaise
Binary Data
Chips (large) 320 98 61 250 grams of chips Binary Data
Chips (small) 240 88 57 150 grams of chips Binary Data
Coleslaw (large) 450 10 0 500 grams of coleslaw Binary Data
Coleslaw (small) 300 10 0 250 grams of coleslaw Binary Data
Potato and gravy (large) 450 10 0 500 grams of potato and gravy Binary Data
Potato and gravy (small) 300 10 0 250 grams of potato and gravy Binary Data
Soft Drink (large) 260 22 0 500ml soft drink Binary Data
Andrew Cole 26 CIS211 7208383 July 2011
ProductName Price PrepTime DeadTime Description Picture
Soft Drink (small) 180 18 0 300ml soft drink Binary Data
Traditional Duck Pieces 100 135 0 Duck Pieces with Traditional Spices Binary Data
Zowie Duck Pieces 100 135 0 Duck Pieces with Hot and Spicy Spices Binary Data
Duck Fillet Burger 495 76 27 A burger with a traditional duck fillet,
lettuce and mayonnaise
Binary Data
Duck Schnitzel Burger 575 86 29 A burger with a duck schnitzel, lettuce
and mayonnaise.
Binary Data
Burger Combo – All The
Way
850 NULL NULL Burger Combo with a All the Way Duck
Burger
Binary Data
Burger Combo – Bacon and
Cheese
850 NULL NULL Burger Combo with a Bacon and Cheese
Duck Burger
Binary Data
Burger Combo – Duck Fillet 850 NULL NULL Burger Combo with a Duck Fillet Burger Binary Data
Burger Combo – Duck
Schnitzel
850 NULL NULL Burger Combo with a Duck Schnitzel
Burger
Binary Data
Dinner for Two 1850 NULL NULL Dinner for Two Combo Binary Data
Regular Feed – Traditional 850 NULL NULL Regular Feed with Traditional Duck
Pieces
Binary Data
Regular Feed – Zowie 850 NULL NULL Regular Feed with Zowie Duck Pieces Binary Data
Big Feed – Traditional 1150 NULL NULL Big Feed with Traditional Duck Pieces Binary Data
Big Feed – Zowie 1150 NULL NULL Big Feed with Zowie Duck Pieces Binary Data
Andrew Cole 27 CIS211 7208383 July 2011
ProductName Price PrepTime DeadTime Description Picture
Family Feast 4250 NULL NULL Family Feast Binary Data
Table 20 - Product Table Sample Data
D.5. MealDeal
ProductName
Burger Combo – All The Way
Burger Combo – Bacon and Cheese
Burger Combo – Duck Fillet
Burger Combo – Duck Schnitzel
Dinner for Two
Regular Feed – Traditional
Regular Feed – Zowie
Big Feed – Traditional
Big Feed – Zowie
Family Feast
Table 21 - MealDeal Table Sample Data
D.6. PhoneOrder
OrderID CallID
2 1
Table 22 - PhoneOrder Table Sample Data
Andrew Cole 28 CIS211 7208383 July 2011
D.7. InternetOrder
OrderID IPAddress
3 152.23.45.12
Table 23 - InternetOrder Table Sample Data
D.8. StoreOrder
OrderID TimeTaken
1 94
Table 24 - StoreOrder Table Sample Data
D.9. Call
CallID StoreID DateTime OnHoldDuration WithAgentDuration
1 1 23.04.2011 12:34 12 135
2 2 23.04.2011 23:35 75 0
Table 25 - Call Table Sample Data
Andrew Cole 29 CIS211 7208383 July 2011
D.10. Menu
MenuID StoreID Description
1 1 Dinner Menu
2 1 Breakfast Menu
3 2 Dinner Menu
4 2 Breakfast Menu
Table 26 - Menu Table Sample Data
D.11. Payment
PaymentID OrderID PaymentType Amount DateStamp
1 1 Cash 12.95 23.04.2011 12:34
2 2 EFTPOST 24.95 23.04.2011 13:21
3 3 Credit 44.95 23.04.2011 08:30
Table 27 - Payment Table Sample Data
Andrew Cole 30 CIS211 7208383 July 2011
D.12. CustomerPhone
Number CustomerID
0407 384 991 1
02 6213 1548 2
03 6587 4478 3
07 4065 6011 4
07 4704 6584 5
0408 235 255 6
0417 123 456 7
0411 111 154 8
0419 546 555 9
03 6426 1559 2
03 6426 2422 3
03 6427 8835 5
0408 270 800 7
Table 28 - CustomerPhone Table Sample Data
Andrew Cole 31 CIS211 7208383 July 2011
D.13. MenuContainsProduct
MenuID ProductName
1 All the Way Duck Burger
1 Aussie Duck Nuggets
1 Bacon and Cheese Duck Burger
1 Chips (large)
1 Chips (small)
1 Coleslaw (large)
1 Coleslaw (small)
1 Soft Drink (large)
1 Soft Drink (small)
1 Traditional Duck Pieces
1 Zowie Duck Pieces
1 Duck Fillet Burger
1 Duck Schnitzel Burger
1 Burger Combo – All The Way
1 Burger Combo – Bacon and Cheese
1 Burger Combo – Duck Fillet
1 Burger Combo – Duck Schnitzel
1 Dinner for Two
Andrew Cole 32 CIS211 7208383 July 2011
MenuID ProductName
1 Regular Feed – Traditional
1 Regular Feed – Zowie
1 Big Feed – Traditional
1 Big Feed – Zowie
1 Family Feast
Table 29 - MenuContainsProduct Table Sample Data
D.14. MenuFeaturesProduct
MenuID ProductName
1 Dinner for Two
1 Regular Feed – Zowie
1 Big Feed – Traditional
1 Family Feast
Table 30 - MenuFeaturesProduct Table Sample Data
D.15. OrderConsistsOfProduct
OrderID ProductName
1 Dinner for Two
2 Regular Feed – Zowie
3 Big Feed – Traditional
Andrew Cole 33 CIS211 7208383 July 2011
Table 31 - OrderConsistsOfProduct Table Sample Data
D.16. MealDealConsistsOfProduct
MealDealName ProductName Quantity
Burger Combo – All The Way All the Way Duck Burger 1
Burger Combo – All The Way Chips (small) 1
Burger Combo – All The Way Soft Drink (small) 1
Burger Combo – Bacon and Cheese Bacon and Cheese Duck Burger 1
Burger Combo – Bacon and Cheese Chips (small) 1
Burger Combo – Bacon and Cheese Soft Drink (small) 1
Burger Combo – Duck Fillet Duck Fillet Burger 1
Burger Combo – Duck Fillet Chips (small) 1
Burger Combo – Duck Fillet Soft Drink (small) 1
Burger Combo – Duck Schnitzel Duck Schnitzel Burger 1
Burger Combo – Duck Schnitzel Chips (small) 1
Burger Combo – Duck Schnitzel Soft Drink (small) 1
Dinner for Two Traditional Duck Pieces 4
Dinner for Two Chips (large) 1
Dinner for Two Soft Drink (small) 2
Dinner for Two Coleslaw (small) 1
Andrew Cole 34 CIS211 7208383 July 2011
MealDealName ProductName Quantity
Dinner for Two Potato and gravy (small) 1
Regular Feed – Traditional Traditional Duck Pieces 2
Regular Feed – Traditional Chips (small) 1
Regular Feed – Traditional Soft Drink (small) 1
Regular Feed – Zowie Zowie Duck Pieces 2
Regular Feed – Zowie Chips (small) 1
Regular Feed – Zowie Soft Drink (small) 1
Big Feed – Traditional Traditional Duck Pieces 3
Big Feed – Traditional Chips (large) 1
Big Feed – Traditional Soft Drink (large) 1
Big Feed – Zowie Zowie Duck Pieces 3
Big Feed – Zowie Chips (large) 1
Big Feed – Zowie Soft Drink (large) 1
Family Feast Traditional Duck Pieces 10
Family Feast Chips (large) 2
Family Feast Soft Drink (small) 4
Family Feast Coleslaw (large) 1
Family Feast Potato and gravy (large) 1
Table 32 - MealDealConsistsOfProduct Table Sample Data