Vous êtes sur la page 1sur 37

Database System Implementation

for Retail Store Final Project


Report

Table of Contents
Database Development Plan.................................................................................... 3

1.

1.1

Database System goals and objectives..................................................................4

1.2

Proposed Database system................................................................................4

1.3

Business Rules............................................................................................... 5

1.4

Entity Relationship Diagram (ERD) of proposed online retail store DBMS.......................6


1.4.1

Entities and Relations................................................................................6

1.4.2

Data dictionary........................................................................................ 7

Customer table..................................................................................................... 7
Products Table..................................................................................................... 7
Order Table......................................................................................................... 8
Categories........................................................................................................... 8
Suppliers............................................................................................................ 9
Purchase Order table.............................................................................................. 9
2.

SQL Queries to Data insertion and manipulation for Retails Store Database System.............10
2.1

SQL to create tables...................................................................................... 10

2.2

SQL to Insert Data........................................................................................ 13

2.2.1

Insert Statements for Customer table...........................................................13

2.2.2

Inset statements for Supplier table..............................................................15

2.2.3

Insert statements for Categories tables.........................................................16

2.2.4

Insert Statements for Products tables...........................................................17

2.2.5

Insert Statements for Order table................................................................18

2.2.6

Insert statement for Purchase Order table......................................................20

2.2.7

Update Product table............................................................................... 21

2.2.8

Delete Order Table row............................................................................21

2.2.9

Update Customer Email id........................................................................21

2.2.10

Update Supplier Address..........................................................................22

2.2.11

Delete Purchase order item.......................................................................22

2.3

SQL Queries to generate reports.......................................................................22

2.3.1

Total revenue (sales) per month, grouped by customer......................................22

2.3.2

Total revenue (sales) per month, grouped by product.......................................23

2.3.3

Total count of products, grouped by category.................................................23

2.3.4

Maximum of product price per unit.............................................................23

3.

4.

2.3.5

Dates of all the Purchase Order..................................................................23

2.3.6

Cross tab query...................................................................................... 23

Database Administration Plan................................................................................ 24


3.1

Database Administration Plan for Online Retail Store Database................................24

3.2

DB Administration Plan.................................................................................24

3.3

Transaction Management Plan.........................................................................26

3.4

Database Security Procedure........................................................................... 27

3.5

Backup and Recovery Model...........................................................................30

Data warehouse and future development plan.............................................................31


4.1

Different Database Systems.............................................................................31

4.2

Distributed database requirements.....................................................................32

4.3

Benefits of proposed Database Distributed system approach....................................33

4.4

Addressing the problems................................................................................ 36

References.............................................................................................................. 37

1. Database Development Plan

Current case study focuses on the retail store business environment and is need of an
automated Database System that can store, retrieve, update and synchronize the data
requirements of a typical retail store entities. Retail store has simple and static web pages
with no external interactions with the customers, suppliers or other stakeholders and thus, a
proper implementation of the dynamic website and associated DBMS is required for the
current case study. Online transactions like customer login, registration, purchase or sales
online and stock updates are not available for the current retail store and thus, a proper
dynamic data synchronization and update system is required (Devarajan, 2014) and the actual
business goals, objectives and proposed DBMS model is discussed in the following sections

1.1 Database System goals and objectives

High level goals and objectives of the proposed Database System for the current case of retail
store against dynamic website development are discussed and listed below

To design, configure and deploy a standards SQL Server Database with the required
dynamic database entities i.e. Customers, Orders, Products, Purchase Orders,

Categories and Suppliers


These entities are now converted to database tables with required columns, attributes,

relationships i.e. primary key and foreign keys and constraints


Establish relationship among the tables identified and develop a detailed flow using

ERD (Entity Relationship Diagram)


Insert data into the tables as per the schema developed and perform CURD operations

with the help of SQL Queries


Generate reports using the queries for the database tables and the corresponding data
updates done

1.2 Proposed Database system

Database system, as proposed for the current online store of the retail business will meet the
dynamic interactions as required for the customers, managers and suppliers as well. SQL
Server can handle large datasets and for the proposed retail store online operations, customers
table will hold the data related to all the registered customers and their respective
authentication details i.e. customer id and customer password. Customers will login with their
authentication credentials and shop online i.e. purchase products, add products to the cart and
pay online (Tolman, 2014).
Products available with the current retail store will be made visible to the customers in the
products under various categories and the respective data will be stored or fetched from the
products and categories tables respectively. Thus the main problem as stated in the case study
with respective to dynamic interactions will be solved with the customer, orders, products and
categories tables (Miller, 2013). Further optimization to the proposed DBMS system will be
done by adding the required suppliers, billing and purchase information and will be discussed
in later parts of the document.

1.3 Business Rules

Business rules as defined and assumed against the implementation of proposed DBMS
system for online retail store operations are as listed

Every customer must be registered with the system and login further to access the
online operations of the retail store i.e. viewing, selecting, purchasing and payment

for their products and orders


Each and every order has a minimum of 1 product under a single category
Customers can select multiple products from same category and act on multiple

categories as well
Order of customers will contain the information related to products, categories,

quantity, discounts and final price (Soam, 2013)


Payment will have two types of options i.e. Cash on delivery or Pay online
Suppliers information is accessed by the retail store administrators and each supplier
can supply multiple categories of products

1.4 Entity Relationship Diagram (ERD) of proposed online retail store DBMS

1.4.1

Entities and Relations

Entities as identified at this level for the proposed online and dynamic retail store DBMS
system are listed below

Customers
Orders
Products
Categories
Suppliers
Billing

More or additional entities might be included while developing the actual DBMS in SQL
Server and the high-level ERD post 3NF is as shown below

Fig: Entity Relationship Diagram of Proposed Online Retail Store DBMS


6

1.4.2

Data dictionary

Detailed data dictionary of the entities as shown in the above ERD are given below

Customer table

Column name
CustID
custFName
custLName
custPassword

Data type
Varchar(20)
Varchar(20)
Varchar(20)
Varchar(20)

Constraints
Primary key
Required

Description
Customer login id
Customer
first

Required

name
Customer

last

Required

name
Customer

login

custAddress

Varchar(40)

Required

password
Customer contact

custEmail

Varchar(20)

Required

address
Customer

Required

address
Customer contact

custPhone

Number(15)

email

phone or mobile
number

Products Table

Column name
prodID
prodName
prodCategoryID

Data type
Varchar(20)
Varchar(20)
Varchar(20)

Constraints
Primary key
Required
Required, Foreign key

Description
Product unique id
Product name
Foreign
key
reference

prodPriceperUnit

Number(5)

Required

category table
Product price per
unit

from

Order Table

Column name
ordered
orderDate
productID

Data type
Varchar(20)
Date
Varchar(20)

Constraints
Primary key
Required
Required, Foreign key

Description
Order unique id
Order date
Foreign
key
reference

customerID

Varchar(20)

Required, Foreign key

from

product table
Foreign
key
reference

productQuantity

Number(5)

Required

from

customer table
Product quantity
purchased

Discounts
finalBill

Number(5)
Number(5)

over

NA

the order
Discount if any to

Require

the customer
Final
bill
calculated
on

the

is

based
product

quantity and price


per unit

Categories

Column name
catID

Data type
Varchar(20)

Constraints
Primary key

Description
Category unique

categoryName
supplierID

Varchar(20)
Varchar(20)

Required
Required, Foreign key

id
Category name
Foreign
key
reference

stockQuantity

Number(5)

Required

from

Suppliers table
Stock available
for the particular
category

Suppliers

Column name
supplierID
supplierName
supplierAddress
supplierPhone

Data type
Varchar(20)
Varchar(20)
Varchar(20)
Number(15)

Constraints
Primary key

Description
Supplier unique

Required
Required
Required

ID
Supplier Name
Supplier Address
Supplier Phone

supplierEmail

Varchar(20)

Required

number
Supplier

supplierAltContact

Numer(15)

Required

address
Supplier

Email

Alternative
Contact number

Purchase Order table

Column name
poID

Data type
Varchar(20)

Constraints
Primary key

Description
Purchase
order

supplierID

Varchar(20)

Required, Foreign key

unique ID
Foreign

key

reference

from

prodID

Varchar(20)

Required, Foreign key

Supplier table
Foreign
key
reference

poDate
Quantity

Date
Number(10)

from

Required

Product table
Purchase
order

Required

date
Quantity of the

poPrice

Numer(10)

Required

products
Price
of

poStatus

Varchar(10)

Required

purchase order
Status of the
purchase order

the

2. SQL Queries to Data insertion and manipulation for Retails Store Database
System

2.1 SQL to create tables

Following SQL queries are written and executed to create the tables for the proposed
Database system of retail store
CREATE TABLE CUSTOMERS(
CustID Varchar(10)

NOT NULL,

CustFNAME VARCHAR (20)

NOT NULL,

CustLNAME VARCHAR (20)

NOT NULL,

CustPassword VARCHAR (20)

NOT NULL,

CustAddress VARCHAR (40)


CustEmail VARCHAR (20)
CustPhone LONG

NOT NULL,
NOT NULL,

NOT NULL,

PRIMARY KEY (CustID) );

CREATE TABLE Suppliers(


SupplierID Varchar(10)

NOT NULL,

SupplierNAME VARCHAR (20)


SupplierAddress VARCHAR (20)
SupplierEmail VARCHAR (20)
SupplierPhone LONG

NOT NULL,
NOT NULL,

NOT NULL,

PRIMARY KEY (SupplierID) );


10

NOT NULL,

CREATE TABLE Categories(


CatID Varchar(10)

NOT NULL,

CatNAME VARCHAR (20)


stockQuantity INT

NOT NULL,

NOT NULL,

SupplierID VARCHAR (20) references Suppliers(SupplierID)

NOT NULL,

PRIMARY KEY (CatID) );

CREATE TABLE Products(


ProductID Varchar(10)

NOT NULL,

ProductNAME VARCHAR (20)

NOT NULL,

ProdCategoryID VARCHAR(20) references Categories(CatID)


ProductPriceperUnit INT NOT NULL,
PRIMARY KEY (ProductID) );

CREATE TABLE Orders(


OrderID Varchar(10)
11

NOT NULL,

NOT NULL,

OrderDate DATE

NOT NULL,

ProdID VARCHAR(20) references Products(ProductID)

NOT NULL,

CustID VARCHAR(20) references CUSTOMERS(CustID)

NOT NULL,

ProductQuantity INT NOT NULL,


Discounts INT NOT NULL,
finalBillAmount INT NOT NULL,
PRIMARY KEY (OrderID) );

CREATE TABLE PurchaseOder(


PoID Varchar(20)
PoDate DATE

NOT NULL,

NOT NULL,

ProdID VARCHAR(20) references Products(ProductID)

NOT NULL,

SupplierID VARCHAR(20) references Suppliers(SupplierID)


Quantity INT NOT NULL,
PoPrice INT NOT NULL,
PoStatus VARCHAR(20),
PRIMARY KEY (PoID) );

2.2 SQL to Insert Data

12

NOT NULL,

For each and every table as created, 20 rows are inserted using the below SQL queries

2.2.1

Insert Statements for Customer table

INSERT INTO CUSTOMERS VALUES (Cust001, 'Parker', 'R', 'cust1', '14-12-7, XYZ Lane,
Newyork', 'parker001@gmail.com', 00122342 );
INSERT INTO CUSTOMERS VALUES (Cust002, 'Prince', 'G', 'cust2', '9/B/8, BridgeLane',
'prince002@gmail.com', 001889722 );
INSERT INTO CUSTOMERS VALUES (Cust003, 'Aarush', 'King', 'cust3', '16/C/21,
Lakeview Towers', 'kingi90@yahoomail.com', 019083232 );
INSERT INTO CUSTOMERS VALUES (Cust004, 'Sunny', 'J', 'cust4', '89/2, Towers',
'jsunny009@gmail.com', 0364837 );
INSERT INTO CUSTOMERS VALUES (Cust005, 'James', 'C', 'cust5', '67/12/09, NielRoad',
'cjames1212@gmail.com', 01133432 );
INSERT INTO CUSTOMERS VALUES (Cust006, 'Allock', 'Y', 'cust6', '70-3-3/3',
'yalloock98@gmail.com', 0112231 );
INSERT INTO CUSTOMERS VALUES (Cust007, 'Michel', 'D', 'cust7', '001, Hieghts Lane',
'micheld1010@gmail.com', 02191231 );
INSERT INTO CUSTOMERS VALUES (Cust008, 'Jackson', 'I', 'cust8', 'Readers avenue
road, 45/f', 'ijack001111@gmail.com', 021998);
INSERT INTO CUSTOMERS VALUES (Cust009, 'Great', 'B', 'cust9', 'Bull street, 9th house',
'bgrtmeoo011@gmail.com', 0119921);
INSERT INTO CUSTOMERS VALUES (Cust010, 'Philips', 'S', 'cust10', 'Electronics hub
road, 19th lane', 'spsps00118@gmail.com', 0112351);
INSERT INTO CUSTOMERS VALUES (Cust011, 'Laura', 'O', 'cust11', 'Indian hub lane, 8th
avenue', 'olaura008@gmail.com', 0984201);

13

INSERT INTO CUSTOMERS VALUES (Cust012, 'Anna', 'T', 'cust12', 'Main street, Park
lane', 'annatg9900@gmail.com', 010901);
INSERT INTO CUSTOMERS VALUES (Cust013, 'Harika', 'V', 'cust13', 'Richmond view
towers, flat 67', 'vharika1259@gmail.com', 0198654);
INSERT INTO CUSTOMERS VALUES (Cust014, 'Haness', 'Q', 'cust14', 'Town road',
'hanessq1818@gmail.com', 014524);
INSERT INTO CUSTOMERS VALUES (Cust015, 'Gates', 'B', 'cust15', 'MS Avenue, 1st
building, 2nd floor', 'gatesbms2014@gmail.com', 010091);
INSERT INTO CUSTOMERS VALUES (Cust016, 'Rams', 'P', 'cust16', 'V Raod, Kth floor',
'prams0023@gmail.com', 0123412);
INSERT INTO CUSTOMERS VALUES (Cust017, 'Aaram', 'M', 'cust17', 'PK road, 32/12',
'maaram0011@gmail.com', 042012);
INSERT INTO CUSTOMERS VALUES (Cust018, 'Bills', 'F', 'cust18', 'Jawhar steet, 98-5t',
'fbills8190@gmail.com', 011331);
INSERT INTO CUSTOMERS VALUES (Cust019, 'Chand', 'S', 'cust19', 'Primary road,
lakeview avenue', 'schandmaths560@gmail.com', 0122119);
INSERT INTO CUSTOMERS VALUES (Cust020, 'Brown', 'W', 'cust20', 'Red water road,
3rd building, 2nd floor', 'wbrown77660@gmail.com', 013898);
2.2.2

INSERT

Inset statements for Supplier table

INTO

Suppliers

VALUES

('Supp001',

'FirstSupp',

'Wall

street',

'bestsuppliers009@gmail.com', 089987);
INSERT INTO Suppliers VALUES ('Supp002', 'SecondSupp', 'Cook book street',
'secondsuppliers0087@gmail.com', 081107);
INSERT INTO

Suppliers

VALUES

'thirdsuppliers054@gmail.com', 088675);

14

('Supp003',

'ThirdSupp',

'Bankers

chambers',

INSERT

INTO

Suppliers

VALUES

('Supp004',

'FourthSupp',

'Finance

towerss',

'fourthsuppliers11@gmail.com', 080051);
INSERT INTO Suppliers VALUES ('Supp005', 'FifthSuppliers', 'Great Britian towers',
'fifthuppliers112@gmail.com', 097051);
INSERT

INTO

Suppliers

VALUES

('Supp006',

'SixthSuppliers',

'Lower

towers',

'sixthsuppliers2314@gmail.com', 0911892);
INSERT INTO Suppliers VALUES ('Supp007', 'SeventhSuppliers', 'Top raod avenue',
'seventhsuppliers1241@gmail.com', 078811);
INSERT INTO Suppliers VALUES ('Supp008', 'EightSuppliers', 'Down moon towers',
'eitsupp9999gmail.com', 0122441);
INSERT INTO Suppliers VALUES ('Supp009', 'NineSuppliers', 'National partk roads',
'ninesupp007gmail.com', 019191);
INSERT

INTO

Suppliers

VALUES

('Supp010',

'TenthSuppliers',

'Clock

towers',

'tnsupp0110gmail.com', 010081);
INSERT INTO Suppliers VALUES ('Supp011', 'levenSuppliers', 'Green park avenue',
'levelnsupp88gmail.com', 0119911);
INSERT INTO Suppliers VALUES ('Supp012', 'twlevSuppliers', 'Marcks buildings',
'twlevupp3311gmail.com', 01891);
INSERT INTO Suppliers VALUES ('Supp013', 'thirteenSuppliers', 'Dragon avenye',
'thirteensupp001gmail.com', 099132);
INSERT INTO Suppliers VALUES ('Supp014', 'fourteenSuppliers', ' upper avenuie',
'fourteensupp1200gmail.com', 029811);
INSERT INTO Suppliers VALUES ('Supp015', 'fifteenSuppliers', ' Director chambers, 4th
building', 'fifteensupp10gmail.com', 011513);
INSERT INTO Suppliers VALUES ('Supp016', 'SixteSuppliers', ' GANPAT, 233 block',
'ramssupp16gmail.com', 016181);

15

INSERT INTO Suppliers VALUES ('Supp017', 'SeventSuppliers', ' HP road, 11th avenue',
'sevntensupp16gmail.com', 091718);
INSERT INTO Suppliers VALUES ('Supp018', 'EighteenSuppliers', ' MS avenue, 14th block',
'eighteensupp190gmail.com', 098888);
INSERT INTO Suppliers VALUES ('Supp019', 'NinetenSuppliers', ' Brigade bridge down,
1114th block', 'ninetensupp190gmail.com', 010288);
INSERT INTO Suppliers VALUES ('Supp020', 'TwotenSuppliers', ' Raheza towers, C block,
2nd floor', 'twnetysupp020gmail.com', 010202);

2.2.3

Insert statements for Categories tables

INSERT INTO Categories VALUES ('Catg001', 'Shoes', 20000, 'Supp001');


INSERT INTO Categories VALUES ('Catg002', 'Laptops', 9100, 'Supp003');
INSERT INTO Categories VALUES ('Catg003', 'Gadgets', 11900, 'Supp006');
INSERT INTO Categories VALUES ('Catg004', 'Food', 981200, 'Supp010');
INSERT INTO Categories VALUES ('Catg005', 'Drinks', 50000, 'Supp004');
INSERT INTO Categories VALUES ('Catg006', 'Games',23000, 'Supp011');
INSERT INTO Categories VALUES ('Catg007', 'Electronics',142000, 'Supp014');
INSERT INTO Categories VALUES ('Catg008', 'Stationary',9900, 'Supp016');
INSERT INTO Categories VALUES ('Catg009', 'General',34800, 'Supp019');
INSERT INTO Categories VALUES ('Catg010', 'Pharma',80087, 'Supp020');
INSERT INTO Categories VALUES ('Catg011', 'Accessories',10000, 'Supp013');
INSERT INTO Categories VALUES ('Catg012', 'Inners',20100, 'Supp002');
INSERT INTO Categories VALUES ('Catg013', 'Frozen',19222, 'Supp005');

16

INSERT INTO Categories VALUES ('Catg014', 'Hot Beverages',7800, 'Supp007');


INSERT INTO Categories VALUES ('Catg015', 'House hold',123990, 'Supp009');
INSERT INTO Categories VALUES ('Catg016', 'Cosmotics',16230, 'Supp012');
INSERT INTO Categories VALUES ('Catg017', 'Spares',11221, 'Supp018');
INSERT INTO Categories VALUES ('Catg018', 'Clothes',9812341, 'Supp017');
INSERT INTO Categories VALUES ('Catg019', 'Toys',53410, 'Supp020');
INSERT INTO Categories VALUES ('Catg020', 'Health and Beauty',200010, 'Supp016');

2.2.4

Insert Statements for Products tables

INSERT INTO Products VALUES ('Prod001', 'Mdew','Catg005', 9);


INSERT INTO Products VALUES ('Prod002', 'Loreal Paris','Catg020', 16);
INSERT INTO Products VALUES ('Prod003', 'DELL','Catg002', 267);
INSERT INTO Products VALUES ('Prod004', 'ASUS','Catg002', 210);
INSERT INTO Products VALUES ('Prod005', 'Nescafe250g','Catg014', 12);
INSERT INTO Products VALUES ('Prod006', 'SpikeBoard','Catg007', 6);
INSERT INTO Products VALUES ('Prod007', 'Nike','Catg001', 56);
INSERT INTO Products VALUES ('Prod008', 'Remote controlled Car','Catg019', 14);
INSERT INTO Products VALUES ('Prod009', 'Sony LED 47 inches','Catg007', 1400);
INSERT INTO Products VALUES ('Prod010', 'Acnoff soap','Catg016', 10);
INSERT INTO Products VALUES ('Prod011', 'Turner screw','Catg017', 4);
INSERT INTO Products VALUES ('Prod012', 'Washing machine cover','Catg015', 11);
INSERT INTO Products VALUES ('Prod013', 'UCM Male L','Catg012', 20);
17

INSERT INTO Products VALUES ('Prod014', 'Keyboard USB','Catg011', 30);


INSERT INTO Products VALUES ('Prod015', 'Return of Empire DVDV01','Catg006', 70);
INSERT INTO Products VALUES ('Prod016', 'Chicken 1kg','Catg004', 9);
INSERT INTO Products VALUES ('Prod017', 'Dry fruits pack','Catg004', 19);
INSERT INTO Products VALUES ('Prod018', 'Domex liquid','Catg015', 2);
INSERT INTO Products VALUES ('Prod019', 'Levis Straturs 34 Jeans','Catg018', 20);
INSERT INTO Products VALUES ('Prod020', 'iPad Headphones','Catg003', 120);

2.2.5

Insert Statements for Order table

INSERT INTO Orders VALUES ('Ord001', 'Jan-12-2015','Prod018', 'Cust002', 2, 0, 4);


INSERT INTO Orders VALUES ('Ord002', 'Feb-10-2015','Prod016', 'Cust001', 3, 1, 7);
INSERT INTO Orders VALUES ('Ord003', 'Feb-12-2015','Prod012', 'Cust006', 12, 0, 128);
INSERT INTO Orders VALUES ('Ord004', 'Jan-09-2015','Prod011', 'Cust008', 6, 2, 180);
INSERT INTO Orders VALUES ('Ord005', 'June-12-2015','Prod009', 'Cust018', 16, 5, 90);
INSERT INTO Orders VALUES ('Ord006', 'July-14-2015','Prod002', 'Cust011', 12, 3, 102);
INSERT INTO Orders VALUES ('Ord007', 'March-05-2015','Prod010', 'Cust020', 21, 0,
100);
INSERT INTO Orders VALUES ('Ord008', 'March-15-2015','Prod004', 'Cust005', 11, 1,
200);
INSERT INTO Orders VALUES ('Ord009', 'April-11-2015','Prod007', 'Cust015', 21, 2, 196);
INSERT INTO Orders VALUES ('Ord010', 'May-15-2015','Prod013', 'Cust013', 5, 0, 210);
INSERT INTO Orders VALUES ('Ord011', 'August-15-2015', 'Prod003', 'Cust012', 10, 1,
110);
18

INSERT INTO Orders VALUES ('Ord012', 'June-23-2015', 'Prod005', 'Cust016', 20, 3, 510);
INSERT INTO Orders VALUES ('Ord013', 'July-13-2015', 'Prod020', 'Cust002', 8, 0, 100);
INSERT INTO Orders VALUES ('Ord014', 'October-13-2015', 'Prod006', 'Cust009', 18, 2,
270);
INSERT INTO Orders VALUES ('Ord015', 'December-03-2015', 'Prod008', 'Cust010', 9, 0,
22);
INSERT INTO Orders VALUES ('Ord016', 'September-12-2015', 'Prod018', 'Cust004', 11, 1,
130);
INSERT INTO Orders VALUES ('Ord017', 'Feb-14-2015', 'Prod001', 'Cust014', 14, 2, 310);
INSERT INTO Orders VALUES ('Ord018', 'April-10-2015', 'Prod012', 'Cust011', 12, 0, 110);
INSERT INTO Orders VALUES ('Ord019', 'April-16-2015', 'Prod011', 'Cust017', 13, 2, 200);
INSERT INTO Orders VALUES ('Ord020', 'December-16-2015', 'Prod016', 'Cust016', 16, 5,
100);

2.2.6

Insert statement for Purchase Order table

INSERT INTO PurchaseOder VALUES ('PoID001', 'Jan-06-2015', 'Prod006', 'Supp001', 16,


200, 'Delivered');
INSERT INTO PurchaseOder VALUES ('PoID002', 'June-26-2015', 'Prod016', 'Supp011',
2000, 12200, 'Delivered');
INSERT INTO PurchaseOder VALUES ('PoID003', 'Feb-02-2015', 'Prod011', 'Supp001',
190, 1220, 'Delivered');
INSERT INTO PurchaseOder VALUES ('PoID004', 'March-12-2015', 'Prod010', 'Supp016',
290, 4210, 'Delivered');
INSERT INTO PurchaseOder VALUES ('PoID005', 'March-11-2015', 'Prod009', 'Supp012',
5600, 334210, 'Delivered');
19

INSERT INTO PurchaseOder VALUES ('PoID006', 'May-14-2015', 'Prod015', 'Supp002',


600, 1240, 'Delivered');
INSERT INTO PurchaseOder VALUES ('PoID007', 'May-23-2015', 'Prod005', 'Supp006',
1200, 23100, 'Returned');
INSERT INTO PurchaseOder VALUES ('PoID008', 'June-13-2015', 'Prod015', 'Supp001',
1300, 131100, 'Returned');
INSERT INTO PurchaseOder VALUES ('PoID009', 'June-23-2015', 'Prod008', 'Supp020',
1000, 10000, 'Failed');
INSERT INTO PurchaseOder VALUES ('PoID010', 'July-13-2015', 'Prod018', 'Supp004',
2000, 123000, 'Failed');
INSERT INTO PurchaseOder VALUES ('PoID011', 'July-12-2015', 'Prod006', 'Supp001',
1020, 21400, 'Failed');
INSERT INTO PurchaseOder VALUES ('PoID012', 'August-10-2015', 'Prod017', 'Supp018',
790, 242100, 'Delivered');
INSERT INTO PurchaseOder VALUES ('PoID013', 'September-11-2015', 'Prod013',
'Supp013',1300, 130002, 'Pending');
INSERT INTO PurchaseOder VALUES ('PoID014', 'September-01-2015', 'Prod009',
'Supp003',9800, 1980022, 'Pending');
INSERT

INTO

PurchaseOder

VALUES

('PoID015',

'October-23-2015',

'Prod020',

'Supp007',9200, 90223, 'Pending');


INSERT INTO PurchaseOder VALUES ('PoID016', 'December-16-2015', 'Prod016',
'Supp016',9200, 162300, 'Delivered');
INSERT INTO PurchaseOder VALUES ('PoID017', 'October-20-2015', 'Prod020', 'Supp009',
1200, 98100, 'Delivered');
INSERT INTO PurchaseOder VALUES ('PoID020', 'July-20-2015', 'Prod020', 'Supp010',
14300, 53105500, 'Delivered');

20

2.2.7

Update Product table

UPDATE Products SET ProductPriceperunit = 20 WHERE


ProductID = 'Prod002';
2.2.8

Delete Order Table row

DELETE FROM Orders WHERE OrderID = 'Ord020';

2.2.9

Update Customer Email id

UPDATE CUSTOMERS SET CustEmail =


'updatemai009@gmail.com' WHERE
CustID = 'Cust012';
2.2.10 Update Supplier Address

UPDATE Suppliers SET SupplierAddress = 'New


address of the supplier' WHERE
SupplierID =
'Supp008';

2.2.11 Delete Purchase order item

DELETE FROM PurchaseOder WHERE PoStatus =


'Failed';

21

2.3 SQL Queries to generate reports

2.3.1

Total revenue (sales) per month, grouped by customer

SELECT CUSTOMERS.CustID, Sum(Orders.finalBillAmount) AS SumOffinalBillAmount,


Orders.OrderDate FROM CUSTOMERS INNER JOIN Orders ON CUSTOMERS.CustID =
Orders.CustID GROUP BY CUSTOMERS.CustID, Orders.OrderDate;

2.3.2

Total revenue (sales) per month, grouped by product

SELECT Sum(Orders.finalBillAmount) AS SumOffinalBillAmount, Count(Orders.ProdID)


AS CountOfProdID, Orders.OrderDate FROM Products INNER JOIN Orders ON
Products.ProductID = Orders.ProdID GROUP BY Orders.OrderDate;
2.3.3

Total count of products, grouped by category

SELECT Count(Products.ProductID) AS CountOfProductID, Products.ProdCategoryID


FROM Categories INNER JOIN Products ON Categories.CatID = Products.ProdCategoryID
GROUP BY Products.ProdCategoryID;

22

2.3.4

SELECT

Maximum of product price per unit

Max(Products.ProductPriceperUnit)

AS

MaxOfProductPriceperUnit,

Products.ProdCategoryID, Categories.SupplierID FROM Suppliers INNER JOIN (Categories


INNER

JOIN

Products

ON

Categories.CatID

Products.ProdCategoryID)

ON

Suppliers.SupplierID = Categories.SupplierID GROUP BY Products.ProdCategoryID,


Categories.SupplierID;
2.3.5

Dates of all the Purchase Order

SELECT PurchaseOder.PoDate, Count(PurchaseOder.SupplierID) AS CountOfSupplierID,


PurchaseOder.PoID FROM Products INNER JOIN (Suppliers INNER JOIN PurchaseOder
ON

Suppliers.SupplierID

PurchaseOder.SupplierID)

ON

Products.ProductID

PurchaseOder.ProdID GROUP BY PurchaseOder.PoDate, PurchaseOder.PoID;

2.3.6

Cross tab query

TRANSFORM

Avg(Orders.finalBillAmount)

CUSTOMERS.CustID

FROM

AS

CUSTOMERS

AvgOffinalBillAmount
INNER

JOIN

SELECT

Orders

ON

CUSTOMERS.CustID = Orders.CustID GROUP BY CUSTOMERS.CustID PIVOT


Orders.Discounts;

3. Database Administration Plan

Administration of the developed database is one of the complex issues for DB maintenance
and includes lot of factors in consideration. For the current DBMS as proposed, designed and
implemented for Retail Store online transactions, there are few security and access related
issues as mentioned in the case study evaluation. Based on these issues, a detailed
administration and transaction management plan is developed and discussed in this report.
Few issues with respective to the DBMS maintenance are considered or assumed in prior to
23

develop the transaction management and administration plan, which widely includes notes
related to recovery, backup, role based administration or DB login and group based access to
the DB entities (Lucila, 2014). Thus to achieve the key DB administration factors or
requirements like availability, maintainability, security and recovery, a proper DB
administration and transaction management plan is required and given in the below sections

3.1 Database Administration Plan for Online Retail Store Database

For the current needs of Retail stores, a simple Database administration plan can be
developed by considering the main users, groups and roles those access the DB objects and
entities at regular intervals and the high level plan as considered for the Online transactions
of Retail DBMS is as given below

3.2 DB Administration Plan

DB administration plan that suits the security, backup, recovery and user management of the
proposed Retail store DBMS has few important aspects considered and they are as listed
below

All the users of the Retail Store DBMS system will be identified and categorized over

user groups and assigned on the centralized DBMS Server


User groups will include different types like Customers Group, Store Managers

Group, Administrators Group and Anonymous group


Access Control List (ACL) will be prepared on the centralized DBM server with the

fields like user name, user id, user role, responsibilities and access levels
Various access permissions and levels are given to the user groups created on the
centralized DBMS Server and these will include Creator, Editor, Author, Default and

Administrator (Pearl, 2012)


Based on the access roles and responsibilities assigned to the user groups on the
DBMS Server, users can access the key entities and data over their client machines or
server machines

24

Scheduled Agents, Automatic run mode agents and Triggers will act on the DBMS
server and verifies the user certificates and actions. A log will be maintained as a

separate table, where DB admin can access and take the necessary actions also
These triggers will also synchronize or update the database events or functions or
updates those happen on different local copies or replicas and reflect them on the

centralized DBMS Server at the end of the day


DBMS Server is maintained on SQL Server environment and RAID technology will
be used to take regular backups of the data to avoid data loss or theft (Marshall,
2015)

A sample SQL Server DBMS Administration console as used for the current Retail Store
Database System is as given below

3.3 Transaction Management Plan

Transaction management plan is required for enhanced performance of the current online
retail store Database Management System Server and the high level plan is as discussed
below

25

A simple Main transaction plan that can be employed for the current retail store is shown in
the above flow chart. Stored procedures are used in this context to add data and all the update
operations as written with UPDATE SQL Statement will trigger other Autonomous
transactions via a unique trigger. This trigger logs all the DML actions those happen on the
database entities of retail stored against checking UPDATE, DELETE and INSERT queries.
Now, the Rollback and Commit are also recorded over the log as written over the AT
(Autonomous Transaction) and the final commit will be done by recording the values to the
log i.e. commit code and user who has acted on the UPDATE operations on the DBMS
(Barber, 2015)
3.4 Database Security Procedure

Principles, policies and standards as required securing the Database of Retail Store are
considered over a simple procedure that runs on the centralized DBMS Server and the high
level flow is as given below

26

From the above procedure followed for the current DBMS of retail store, a single DB
instance is created against each secured SQL Server login and the required access the
database is achieved using the following metrics

27

User
Symmetric key
Services
Role
Asymmetric key

Assembly
Application level role and access
Remote Service Binding
Message type
Schema (Majid, 2013)

Windows based user and user group authentication is possible at the SQL Server
Administration console as shown below

3.5 Backup and Recovery Model

28

Once these aspects are considered over the secured procedure, further user and user group
level permissions are set using the remote service bindings process. Required disaster
recovery procedure that is used over the centralized DBMS SQL Server of Retail Store
operations is as given below
Msg 33111, Level 16, State 3, Line 1
Cannot find server certificate with thumbprint
'0xFBFF1103AF133C22231AE2DD1D0CC6777366AAF1'.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally

A simple DB backup and recovery plan as followed for the current DB administration is
shown in the below snapshot

29

4. Data warehouse and future development plan

Detailed review, analysis, evaluation and discussion on various database systems for the
proposed online retail store with respective to DBMS creation, SQL Server updates and
administration plan are discussed in the previous report. From the core case study issues and
solutions as provided in this project, the future Database enhancement scope will vary based
on the varying business needs of the respective retail stores. Business requirements are
changes to meet the online and physical stores of the company and they were in the need of
statistical analysis and reports for all the database operations.
Thus, an enhanced DBMS maintenance and development is required apart from the
traditional SQL Server approach. Based on the intelligence goals of the retail store database
requirements, transfer of the data should be done in a complex way to meet the warehouse
aspects of the company and thus a sophisticated Data Warehouse implementation is required
for the current Database of Retail Store Online and Physical transactions or operations and
the future development plan as required is discussed below

4.1 Different Database Systems

For the current retail store database operations with respective to online and physical store
needs and to meet the future development plan, a desired database system should be selected
or recommended. In general the database systems can vary at a range of three levels like
object oriented, object relation and web based systems and the decisions made to choose the
required database system will impact the current and future DB maintenance of the retail
store database operations. Object oriented database systems can handle the BLOBs like
images, mixed media, audio, video and animations and this type of database is suitable for
single instance or single server database systems.
When the Relational Object oriented database systems are considered, it is always required to
model the data entities or objects with the relationship aspects among these entities as well.
RDBMS systems are relational and hybrid in nature and purely made up of tables and the
corresponding implementation of this type of database systems to meet the retail store data
requirements is discussed in the previous sections. A simple web based database system will
30

have web based access or UI and provides lot of opportunities in terms of HTML and CGI
script level access to the database elements with a simple login or authentication system
(Liao, 2014).
For the current retail store system case study and its future needs, a web based database
approach will be helpful in terms of query and API requirements. Existing infrastructure can
be used to migrate the current database to web based database by setting the required network
like LAN, WAN and Internet connections and providing the user access respectively.

4.2 Distributed database requirements

For migrate or upgrade the current database to distributed systems, a simple Business
intelligence logic can be added to the existing database requirements. BI can be adopted with
the help of SAP BI and SAP HANA. SAP provides complex and high volume database
support for Retail Store operations and the required migration can be done using the standard
procedures. Once the retail store data is shifted or migrated to SAP BI system, architecture of
entire database will be changed to act as typical distributed system and the client level access
can be provided to the end users. SAP BI will provide lot of decision making aspects by
visualizing the reports annually, quarterly and monthly and the entire report generation
process will take few seconds, which is very less when compared to the traditional SQL
Server approach (Delen, 2013). SAP ABAP level programming interface will be used to code
the report requirements and the standard procedures will run on the SAP BI server and the
entire reports can be easily generated as well. This distributed architecture can be held
through a web based access by providing login and authentication as defined at the
administration and ACL level.

4.3 Benefits of proposed Database Distributed system approach

There are few noted benefits with the data warehousing and data distributed system approach
as proposed with SAP BI and few of them are as listed in terms of Return On Investment
(ROI) and an approximate estimate for 3 years is as given below (Mary, 2012)
31

Resources as required for warehousing the current Database requirements of Retail Store is as
given below

Some of the key benefits as associated with the current cost based approach and ROI
calculation for Database warehouse implementation are shown below

32

ROI savings for the proposed project in terms of resource usage and allocation is as given
below

33

A 3 year estimate in terms of cost benefits and savings is calculated for 3 years and given
below

34

4.4 Addressing the problems

Problems associated with data warehousing of the current retail store DBMS can be handled
with few solutions and they are as listed below

Data that is never used can be shifted to archives and can be retrieved based on the

requirements of the system


High demand for disk volume or space can be solved by adding additional RAID
servers and backup servers to the current Data warehouse or BI Server and regular

backup and archiving will help in improving the overall performance as well
All the hidden problems as associated with the source system will be recovered or
handled with automation management tools and techniques and high level end user
training to the resources will help a lot in this context (Haluk, 2013)

35

References

Barber, R. (2015). In-memory BLU acceleration in IBM's DB2 and dashDB:


Optimized for modern workloads and hardware architectures. Data Engineering

(ICDE), 21(1),18-25.
Delen, D. (2013). Leveraging the capabilities of service-oriented decision support
systems:

Putting

analytics

and

big

Systems, 55(1), 412-421.


Devarajan , R. (2014). PROFICIENT

data

in

cloud. Decision

CONSTITUTION

FOR

Support
ONLINE

EDUCATIONAL ENVIRONMENT USING FEEDBACK ANALYSIS. International


Journal

Cognitive

Research

in

Science,

Engineering

and

Education

(IJCRSEE), 2(1), 12-29.


Haluk , D. (2013). Leveraging the capabilities of service-oriented decision support
systems:

of

Putting

analytics

and

big

data

in

cloud. Decision

Support

Systems, 55(1), 412-421.


Liao, S. (2014). Mining Customer Knowledge for a Recommendation System in
Convenience Stores. International Journal of Data Warehousing and Mining

(IJDWM), 20(1),89-91.
Lucila , O. (2014). CLARA: an integrated clinical research administration

system. Journal of the American Medical Informatics Association, 3(1), 12-18.


Majid , R. (2013). Enterprise Data Backup & Recovery: A Generic Approach. IOSR

Journal of Engineering (IOSRJEN), 3(5), 40-47.


Marshall, C. (2015). Clusters, Regional VNets, High Availability, and Disaster

Recovery. Microsoft Azure, 1(2), 301-314.


Mary, C. (2012). Factors influencing business intelligence (BI) data collection

strategies: An empirical investigation. Decision Support Systems, 52(2), 486-497.


Miller, L. (2013). An Integrative Business Case Utilizing An Online

Database. Journal of Business Case Studies (JBCS), 10(1), 15-21.


Pearl, R. (2012). Introduction to Healthy SQL. Healthy SQL, 23(1), 1-17.
Soam, S. (2013). GIS-based Decision Support System (DSS) for Recommending
Retail Outlet Locations. Information and Knowledge Management, 3(4), 212-234.

36

Tolman, M. (2014). Integrating Business Intelligence And Decision Focused Database


Methods: A Prescriptive Principles Approach. International Journal of Management
& Information Systems (IJMIS), 18(1), 654-659.

37

Vous aimerez peut-être aussi