[PROJECT NAME]

Database Model

[April 12, 2010] Date

[1.1] Version

[Approved] Status

[Nguyen Hoang Son, BA] Author

[Le Phi Hung, Project Manager] Reviewed by

[Nguyen Thi Thanh Thuy, Director] Approved by

1

Smart World Technology Co. ltd. Address: 02 No Trang Long Street, ward 13, Binh Thanh District, HCMC Vietnam Phone: 84­8­6674 9024 Fax: 84­8­6258 4459 Website: www.smartworld.com.vn

Revision History

Date Version Description Author

< May 28> < June 8> <1.0> <1.1> < Le Minh Vuong > < Le Minh Vuong >

2

Smart World Technology Co. ltd. Address: 02 No Trang Long Street, ward 13, Binh Thanh District, HCMC Vietnam Phone: 84­8­6674 9024 Fax: 84­8­6258 4459 Website: www.smartworld.com.vn

1 Introduction

1.1 Purpose

[A description of the persistent data storage perspective of the system. This view is OPTIONAL if there is little or no persistent data, or the translation between the Design Model  and the Data Model is trivial.]

1.2 Scope

1.3 Definitions, Acronyms and Abbreviations

No Term Description

1.4 References

1.5 Overview

3

Smart World Technology Co. ltd. Address: 02 No Trang Long Street, ward 13, Binh Thanh District, HCMC Vietnam Phone: 84­8­6674 9024 Fax: 84­8­6258 4459 Website: www.smartworld.com.vn

2 Data Model Detail

This document provides an overview of the data model. For simpler and more focused reports, simply  copy this initial template and turn off the sections not required.

2.1 Data model

Package    Implementation Model (PSM) Created on 5/11/2005. Last modified on 10/15/2008. Type: Package: Detail: Notes:

btxuanngan on 5/11/2005 DDL Created By: Last Modified: 4/23/2007, Version:1.0

4

Smart World Technology Co. ltd. Address: 02 No Trang Long Street, ward 13, Binh Thanh District, HCMC Vietnam Phone: 84­8­6674 9024 Fax: 84­8­6258 4459 Website: www.smartworld.com.vn

class DDL

Data Modeling

Enterpris e Architect supports full definition of data modeling using the UML Data Definition Language (DDL). EA supports data definition for a number of DBMS structures . Below is a data definition for an Oracle DBMS.

Data Modeling

For more information on Data Modeling in EA see:

StockItem

Order

date: Date

«column» Author: string *PK stockItemID: Integer

catalogNumber: string costPrice: number listPrice: number title: string

«column» FK lineItemID: Integer *PK orderID: Integer FK orderStatusID: Integer

deliveryInstructions: String orderNumber: String

«PK» +

PK_StockItem(Integer)

+FK_Order_LineItem

+PK_StockItem

FK_Order_LineItem(Integer) FK_Order_OrderStatus(Integer)

«FK» + +

+PK_Order

(stockItemID = stockItemID)

«PK» +

PK_Order(Integer)

(lineItemID = lineItemID)

(orderID = orderID)

Account

+FK_Account_Order

+PK_LineItem+FK_LineItem_StockItem

LineItem

Transaction

billingAddress: String

+FK_Transaction_Account

«column» *PK lineItemID: Integer quantity: Integer FK stockItemID: Integer

date: Date

+FK_Transaction_LineItem

(accountID = accountID)

«column» *PK accountID: Integer FK orderID: Integer FK shoppingBasketID: Integer

closed: Boolean deliveryAddress: String emailAddress: String name: String

«FK» +

FK_LineItem_StockItem(Integer)

«column» FK accountID: Integer FK lineItemID: Integer *PK transactionID: Integer

orderNumber: String

(lineItemID = lineItemID)

+PK_Account

«PK» +

PK_LineItem(Integer)

FK_Account_Order(Integer) FK_Account_ShoppingBasket(Integer)

«FK» + +

+PK_LineItem

«FK» + +

FK_Transaction_Account(Integer) FK_Transaction_LineItem(Integer)

«PK» +

PK_Account(Integer)

«PK» +

PK_Transaction(Integer)

+FK_Account_ShoppingBasket

(lineItemID = lineItemID)

ShoppingBasket

(shoppingBasketID = shoppingBasketID)

+FK_ShoppingBasket_LineItem

«column» FK lineItemID: Integer *PK shoppingBasketID: Integer

shoppingBasketNumber: String

+PK_ShoppingBasket

+PK_LineItem

«FK» +

FK_ShoppingBasket_LineItem(Integer)

«PK» +

PK_ShoppingBasket(Integer)

Figure: 1

Account 2.1.1

, Stereotype: «table», Package: Data model Created on 5/11/2005.  Last modified on 11/30/2005. Database: Detail: Notes:

Columns

Name Notes

Type PK Integer True accountID String False billingAddress False orderID Integer False shoppingBasketID Integer Not Null Unique Len Prec Scale Init True False False False False False False False

5

Smart World Technology Co. ltd. Address: 02 No Trang Long Street, ward 13, Binh Thanh District, HCMC Vietnam Phone: 84­8­6674 9024 Fax: 84­8­6258 4459 Website: www.smartworld.com.vn

False closed False deliveryAddress False emailAddress False name Boolean False False String False String False String False False False False

Constraints

Initial Code Notes Name FK_Account_Order Type Public Columns orderID

Public shoppingBasketID

FK_Account_ShoppingBas ket PK_Account Public accountID

Relationships

Notes

Columns (shoppingBasketID = shoppingBasketID) (orderID = orderID)

(accountID = accountID) Association Account.FK_Account_ShoppingBasket  ShoppingBasket.PK_ShoppingBasket Account.FK_Account_Order  Order.PK_Order Transaction.FK_Transaction_Account  Account.PK_Account

LineItem 2.1.2

, Stereotype: «table», Package: Data model Created on 5/11/2005.  Last modified on 11/30/2005. Database: Detail: Notes:

Columns

Name Notes

PK True lineItemID False quantity False stockItemID Type Integer Integer Integer Not Null Unique Len Prec Scale Init True False False False False False

Constraints

Initial Code Notes Name FK_LineItem_StockItem Type Public Columns stockItemID

PK_LineItem Public lineItemID

Relationships

Notes Columns (lineItemID = lineItemID)

(lineItemID = lineItemID) Association Transaction.FK_Transaction_LineItem  LineItem.PK_LineItem Order.FK_Order_LineItem  LineItem.PK_LineItem

6

Smart World Technology Co. ltd. Address: 02 No Trang Long Street, ward 13, Binh Thanh District, HCMC Vietnam Phone: 84­8­6674 9024 Fax: 84­8­6258 4459 Website: www.smartworld.com.vn

Notes Columns (stockItemID = stockItemID) LineItem.FK_LineItem_StockItem  StockItem.PK_StockItem (lineItemID = lineItemID) Association

ShoppingBasket.FK_ShoppingBasket_LineItem LineItem.PK_LineItem

2.1.3 Order

, Stereotype: «table», Package: Data model Created on 5/11/2005.  Last modified on 11/30/2005. Database: Detail: Notes:

Columns

Name Notes

PK False date False lineItemID True orderID False orderStatusID False deliveryInstruction Type Date Integer Integer Integer String Not Null Unique Len Prec Scale Init False False True False False False False False False False s False orderNumber String False False

Constraints

Initial Code Notes Name FK_Order_LineItem Type Public Columns lineItemID

FK_Order_OrderStatus Public orderStatusID

PK_Order Public orderID

Relationships

Notes

Columns (orderStatusID = orderStatusID) (lineItemID = lineItemID)

(orderID = orderID) Association Order.FK_Order_OrderStatus  OrderStatus.PK_OrderStatus Order.FK_Order_LineItem  LineItem.PK_LineItem Account.FK_Account_Order  Order.PK_Order

2.1.4 OrderStatus

, Stereotype: «table», Package: Data model Created on 11/30/2005.  Last modified on 11/30/2005. Database: Detail: Notes:

Columns

7

Smart World Technology Co. ltd. Address: 02 No Trang Long Street, ward 13, Binh Thanh District, HCMC Vietnam Phone: 84­8­6674 9024 Fax: 84­8­6258 4459 Website: www.smartworld.com.vn

Notes

Type Integer Integer Integer Integer Integer Integer Not Null Unique Len Prec Scale Init False True False False False False False False False False False False PK Name False closed True orderStatusID False delivered False dispatched False new False packed

Constraints

Initial Code Notes Name PK_OrderStatus Type Public Columns orderStatusID

Relationships

Notes

Columns (orderStatusID = orderStatusID) Association Order.FK_Order_OrderStatus  OrderStatus.PK_OrderStatus

ShoppingBasket 2.1.5

, Stereotype: «table», Package: Data model Created on 5/11/2005.  Last modified on 11/30/2005. Database: Detail: Notes:

Columns

Name Notes

Type PK False lineItemID Integer True shoppingBasketID Integer String False shoppingBasketNu Not Null Unique Len Prec Scale Init False True False False False False mber

Constraints

Initial Code Notes Type Public Columns lineItemID

Name FK_ShoppingBasket_LineI tem PK_ShoppingBasket Public shoppingBasketID

Relationships

Notes Columns (lineItemID = lineItemID) Association

(shoppingBasketID = shoppingBasketID) ShoppingBasket.FK_ShoppingBasket_LineItem LineItem.PK_LineItem Account.FK_Account_ShoppingBasket  ShoppingBasket.PK_ShoppingBasket

StockItem 2.1.6

8

Smart World Technology Co. ltd. Address: 02 No Trang Long Street, ward 13, Binh Thanh District, HCMC Vietnam Phone: 84­8­6674 9024 Fax: 84­8­6258 4459 Website: www.smartworld.com.vn

, Stereotype: «table», Package: Data model Created on 5/11/2005.  Last modified on 11/30/2005. Database: Detail: Notes:

Columns

Notes

PK Name False Author True stockItemID False catalogNumber False costPrice False listPrice False title Not Null Unique Len Prec Scale Init Type False string True Integer string False number False number False False string False False False False False False

Constraints

Initial Code Notes Name PK_StockItem Type Public Columns stockItemID

Relationships

Notes Columns (stockItemID = stockItemID) Association LineItem.FK_LineItem_StockItem  StockItem.PK_StockItem

Transaction 2.1.7

, Stereotype: «table», Package: Data model Created on 5/11/2005.  Last modified on 11/30/2005. Database: Detail: Notes:

Columns

Name Notes

PK False accountID False date False lineItemID True transactionID False orderNumber Type Integer Date Integer Integer String Not Null Unique Len Prec Scale Init False False False True False False False False False False

Constraints

Initial Code Notes Name FK_Transaction_Account Type Public Columns accountID

FK_Transaction_LineItem Public lineItemID

PK_Transaction Public transactionID

Relationships

9

Smart World Technology Co. ltd. Address: 02 No Trang Long Street, ward 13, Binh Thanh District, HCMC Vietnam Phone: 84­8­6674 9024 Fax: 84­8­6258 4459 Website: www.smartworld.com.vn

Notes Columns (lineItemID = lineItemID)

(accountID = accountID) Association Transaction.FK_Transaction_LineItem  LineItem.PK_LineItem Transaction.FK_Transaction_Account  Account.PK_Account

10

Smart World Technology Co. ltd. Address: 02 No Trang Long Street, ward 13, Binh Thanh District, HCMC Vietnam Phone: 84­8­6674 9024 Fax: 84­8­6258 4459 Website: www.smartworld.com.vn