Vous êtes sur la page 1sur 37

Database System Development and Implementation Plan

CS660-1202B-01 Database SystemsAmakobe, Moody


1234 Main street, Suite 301

EMIX Inc. Is a company located in Overland Park, Kansas. It is a 1 - 9 1 3 - 5 5 5 - 0 1 2 2technology company that specializes in the design and 1-913-555-0123 manufacturing of high quality 6 / 2 5 / 2 0 1 2gaming computers, desktop computers, workstations, laptops and servers

EMiX inc. Database System Development and Implementation Plan 2

Table of Contents
Table of Contents........................................................................................................ 2 Database System Overview.........................................................................................3 Introduction............................................................................................................. 3 Problem Statement.................................................................................................. 3 Goals and Objectives................................................................................................3 Entity Relationship (ER) Model.....................................................................................5 Business Rules......................................................................................................... 5 ER- Diagram........................................................................................................... 10 Structured Query Language (SQL) Scripts.................................................................11 Database Definition Language (DDL)......................................................................11 Database manipulation scripts (DML).....................................................................17 Database Administration Plan ...................................................................................27 Transaction management......................................................................................27 Database security procedure.................................................................................28 Backup and recovery.............................................................................................29 Devices and media..............................................................................................30 Future Database System Implementation Plan .........................................................31 ER Model Conversion Description...........................................................................31 Modification Description.........................................................................................33 Query Performance Enhancement Strategy............................................................34 Changes Introduced To the Database.....................................................................35 Data Mart or Data warehouse.............................................................................35 Distributed Database..........................................................................................36 References................................................................................................................ 36

EMiX inc. Database System Development and Implementation Plan 3

Database System Overview


Introduction
EMIX Inc. Is a company located in Overland Park, Kansas. It is a technology company that specializes in the design and manufacturing of high quality gaming computers, desktop computers, workstations, laptops and servers. The company's mission statement is "To exceed customers expectations in quality, delivery and cost by building high quality products and offering outstanding support ("About puget systems," 2011).

Problem Statement
EMIX Inc. currently sells their products from a warehouse/retail shop taking orders from clients over the phone and also accepting walk-ins. The organization would like to increase the geographical reach of its customers and also simplify the ordering process and has proposed an online marketplace or online store that will allow customers to order existing products or build their own systems online. The company currently has an order management system that they would like connected to the website for automatic order management.

Goals and Objectives


To meet the proposed store development, a database system that stores the company data and client information must be built with the following objectives in mind. The database must have an organized way to store data The database must have a convenient retrieval of the data

EMiX inc. Database System Development and Implementation Plan 4

Representation of any selected data must be good The database must be able to store complex data The database must allow other applications to access it The database must be able to run multiple users and applications simultaneously without locking; for business continuity

The database should allow payment gateways to interface with it Security must be paramount to keep client data safe. Building the database will pave way to solving the two business problems stated

above by allowing a website to be created that consumes and stores data to the proposed database, the website will also increase the client base by allowing orders from all over the world, this also closely aligns to the organizations mission statement by the provision of high quality products that customers are allowed to build online by themselves and FAQ section and online helpdesk will also provide round the clock real time support

EMiX inc. Database System Development and Implementation Plan 5

Entity Relationship (ER) Model


Business Rules
A statement that defines or constrains aspects of business and intends to assert the business structure or control and influence the business behavior is termed a s a business rule, with this in mind however we need to put in place flowcharts that will guide us to the creation of this rules. The figure below depicts processes that will be used on the proposed website.
Customer
Main Page Catalog
Customer browses around looking for products.

Shopping Cart
Customer adds products to purchase to shopping cart.

Customer visits main website.

Customer Preference s
Customer changes personal information.

Order Tracking
Customer looks up previous orders.

Checkout
Customer verifies information and pays for products.

Customer Signup
Customer signs up for user account.

Fig 1: Customer Navigation flow chart

EMiX inc. Database System Development and Implementation Plan 6

Store Owner

Main Page
Owner opens admin portion of website.

Reports
Owner can print out reports on stock and various items.

Shipping
Owner can view what orders need to be shipped.

Customer Accounts
Owner can modify account information for the customers.

Inventory
Owner can increase or decrease inventory for the store.

Fig 2: Administrator Navigation flowchart With the given flowcharts we will then create some required business rules Main Page Rules Catalog Rules Customer must be able to navigate to the website Customer must have the ability to navigate the site with ease Customer must be able to search for products by category Customer must be able to search for products by subcategory Customer must be able to search for products by keyword Keywords Must include, product type, name, manufacturer, brand, model and price range

Shopping Cart rules Customer Preferences and sign up

Shopping cart must be secure Customer Must be able to add products to shopping cart Customer personal information must be captured Customer must provide Shipping address

EMiX inc. Database System Development and Implementation Plan 7

Customer must add or choose Payment information Order tracking Customer must be able to lookup previous orders Customer must be able to find order by date purchased Customer must be able to find order by Transaction ID Customer must be able to find order by Product ID Checkout Rules Customer must verify order Customer must be able to update order Customer must verify payment Information Customer must be able to update payment information Customer must be able to checkout. Admin Admin must be able to generate reports by date and product ID Admin must be able to view orders that need to be shipped Admin must be able to edit customer account information Admin must be able to increase or decrease inventory

Entities Entities Product Description This table will store already assembled product information Attributes and Data Types Product ID (int) Name(varchar) Price(double) Weight(double) quantityOnHand(int) reorderPoint Vendor This table will store parts vendor information to allow vendorID(int)

EMiX inc. Database System Development and Implementation Plan 8

customers to build their own product

name(varchar) address(varchar) phone(varchar) contact(varchar) altPhone(varchar) fax(varchar) email(varchar) accountNumber(int) terms(varchar)

Component

This table will store component ComponentID(int) information such as Name(varchar) Motherboard and will have direct relation to the vendor Cost(double) quantityOnHand(int) reorderPoint(int) unitOfMeasure(varchar) description(varchar) venderID(int)

Order

OrderID(int) dateOrdered(date) dateShipped(date) total(double) tax(double) taxid(int) CustomerID(int) Addresseid(int)

EMiX inc. Database System Development and Implementation Plan 9

Customer

Will store customer information customerID(int) along with a boolean to check if customer has a subscription email(varchar) to our weekly newsletter password(varchar) role(varchar) firstName(varchar) lastName(varchar) phone(varchar) dob(date) fax(date) CompanyName(varchar) Subscription(varchar)

PaymentMethod This will store customer credit card information

paymentMethodId(int) type(varchar) owner(varchar) number(int) expires(date) cvv(int) customerID(int)

Address

This will store customer address

addressID(int) type(varchar) street(varchar) city(varchar) state(varchar)

EMiX inc. Database System Development and Implementation Plan 10

customerID(int) zip(int) Backorder This table will be used to store items on backorder backorderID(int) quantity(int) itemid(int) orderId(int)

The table above reflects the general overview of how the tables will look like, other tables might be added to make the database 3NF compliant.

ER- Diagram

EMiX inc. Database System Development and Implementation Plan 11

Structured Query Language (SQL) Scripts


Database Definition Language (DDL)
DDL scripts to create the database schema
USE [master] GO /****** Object: Database [EmixOnline] Script Date: 06/11/2012 18:41:08 ******/ CREATE DATABASE [EmixOnline] ON PRIMARY ( NAME = N'EmixOnline', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\EmixOnline.mdf' , SIZE = 3072KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB ) LOG ON ( NAME = N'EmixOnline_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\EmixOnline_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%) GO USE [EmixOnline] GO /****** Object: Table [dbo].[Customer] ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Customer]( [customerID] [int] NOT NULL, [email] [nchar](10) NULL,

Script Date: 06/11/2012 18:41:11

EMiX inc. Database System Development and Implementation Plan 12

[password] [nchar](10) NULL, [role] [nchar](10) NULL, [firstName] [nchar](10) NULL, [lastName] [nchar](10) NULL, [phone] [nchar](10) NULL, [dob] [date] NULL, [fax] [nchar](10) NULL, [companyName] [nchar](10) NULL, [subscription] [bit] NULL, CONSTRAINT [PK_Customer] PRIMARY KEY CLUSTERED ( [customerID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO /****** Object: Table [dbo].[ZipCode] Script Date: 06/11/2012 18:41:11 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[ZipCode]( [zip] [int] NOT NULL, [city] [nvarchar](50) NOT NULL, [state] [nvarchar](50) NOT NULL, CONSTRAINT [PK_ZipCode] PRIMARY KEY CLUSTERED ( [zip] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO /****** Object: Table [dbo].[Vender] Script Date: 06/11/2012 18:41:11 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Vender]( [venderID] [int] NOT NULL, [name] [nchar](10) NULL, [address] [nvarchar](50) NULL, [phone] [nchar](10) NULL, [contact] [nchar](10) NULL, [altPhone] [nchar](10) NULL, [fax] [nchar](10) NULL, [email] [nvarchar](50) NULL, [accountNumber] [nchar](10) NULL, [terms] [nchar](10) NULL, CONSTRAINT [PK_Vender] PRIMARY KEY CLUSTERED ( [venderID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY]

EMiX inc. Database System Development and Implementation Plan 13

GO /****** Object: Table [dbo].[Tax] Script Date: 06/11/2012 18:41:11 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Tax]( [taxID] [int] NOT NULL, [state] [nchar](10) NULL, [percentage] [decimal](18, 0) NULL, CONSTRAINT [PK_Tax] PRIMARY KEY CLUSTERED ( [taxID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO /****** Object: Table [dbo].[Product] Script Date: 06/11/2012 18:41:11 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Product]( [productID] [int] NOT NULL, [name] [nchar](10) NULL, [price] [money] NULL, [weight] [int] NULL, [quantityOnHand] [int] NULL, [reorderPoint] [nchar](10) NULL, CONSTRAINT [PK_Product] PRIMARY KEY CLUSTERED ( [productID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO /****** Object: Table [dbo].[Payment_Method] Script Date: 06/11/2012 18:41:11 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Payment_Method]( [payementMethodID] [int] NOT NULL, [type] [nchar](10) NULL, [owner] [nchar](10) NULL, [number] [int] NOT NULL, [expires] [date] NULL, [cvv] [smallint] NULL, [customerID] [int] NOT NULL, CONSTRAINT [PK_Payment_Method] PRIMARY KEY CLUSTERED ( [payementMethodID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

EMiX inc. Database System Development and Implementation Plan 14

) ON [PRIMARY] GO /****** Object: Table [dbo].[Component] Script Date: 06/11/2012 18:41:11 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Component]( [componentID] [int] NOT NULL, [name] [nchar](10) NULL, [cost] [money] NULL, [quantityOnHand] [int] NULL, [reorderPoint] [nchar](10) NULL, [unitOfMeasure] [nchar](10) NULL, [description] [nchar](10) NULL, [venderID] [int] NOT NULL, CONSTRAINT [PK_Component] PRIMARY KEY CLUSTERED ( [componentID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO /****** Object: Table [dbo].[Address] Script Date: 06/11/2012 18:41:11 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Address]( [addressID] [int] NOT NULL, [type] [nchar](10) NULL, [street] [nvarchar](50) NULL, [city] [nvarchar](50) NULL, [state] [nvarchar](50) NULL, [customerID] [int] NOT NULL, [zip] [int] NOT NULL, CONSTRAINT [PK_Address] PRIMARY KEY CLUSTERED ( [addressID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO /****** Object: Table [dbo].[Order] Script Date: 06/11/2012 18:41:11 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Order]( [orderID] [int] NOT NULL, [dateOrdered] [date] NULL, [dateShipped] [date] NULL, [total] [money] NULL,

EMiX inc. Database System Development and Implementation Plan 15

[tax] [money] NULL, [taxID] [int] NOT NULL, [customerID] [int] NOT NULL, [addressID] [int] NOT NULL, CONSTRAINT [PK_Order] PRIMARY KEY CLUSTERED

[orderID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO /****** Object: Table [dbo].[Product_Component_Int] Script Date: 06/11/2012 18:41:11 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Product_Component_Int]( [componentID] [int] NOT NULL, [productID] [int] NOT NULL ) ON [PRIMARY] GO /****** Object: Table [dbo].[Order_Product_Int] Script Date: 06/11/2012 18:41:11 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Order_Product_Int]( [quantity] [int] NULL, [orderID] [int] NULL, [productID] [int] NULL ) ON [PRIMARY] GO /****** Object: Table [dbo].[Backorder] Script Date: 06/11/2012 18:41:11 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Backorder]( [backorderID] [int] NOT NULL, [quantity] [int] NOT NULL, [itemID] [int] NOT NULL, [orderID] [int] NOT NULL, CONSTRAINT [PK_Backorder] PRIMARY KEY CLUSTERED ( [backorderID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO /****** Object: ForeignKey [FK_Payment_Method_Customer] Script Date: 06/11/2012 18:41:11 ******/ ALTER TABLE [dbo].[Payment_Method] WITH CHECK ADD CONSTRAINT [FK_Payment_Method_Customer] FOREIGN KEY([customerID])

EMiX inc. Database System Development and Implementation Plan 16

REFERENCES [dbo].[Customer] ([customerID]) GO ALTER TABLE [dbo].[Payment_Method] CHECK CONSTRAINT [FK_Payment_Method_Customer] GO /****** Object: ForeignKey [FK_Component_Vender] Script Date: 06/11/2012 18:41:11 ******/ ALTER TABLE [dbo].[Component] WITH CHECK ADD CONSTRAINT [FK_Component_Vender] FOREIGN KEY([venderID]) REFERENCES [dbo].[Vender] ([venderID]) GO ALTER TABLE [dbo].[Component] CHECK CONSTRAINT [FK_Component_Vender] GO /****** Object: ForeignKey [FK_Address_Customer] Script Date: 06/11/2012 18:41:11 ******/ ALTER TABLE [dbo].[Address] WITH CHECK ADD CONSTRAINT [FK_Address_Customer] FOREIGN KEY([customerID]) REFERENCES [dbo].[Customer] ([customerID]) GO ALTER TABLE [dbo].[Address] CHECK CONSTRAINT [FK_Address_Customer] GO /****** Object: ForeignKey [FK_Address_ZipCode] Script Date: 06/11/2012 18:41:11 ******/ ALTER TABLE [dbo].[Address] WITH CHECK ADD CONSTRAINT [FK_Address_ZipCode] FOREIGN KEY([zip]) REFERENCES [dbo].[ZipCode] ([zip]) GO ALTER TABLE [dbo].[Address] CHECK CONSTRAINT [FK_Address_ZipCode] GO /****** Object: ForeignKey [FK_Order_Address] Script Date: 06/11/2012 18:41:11 ******/ ALTER TABLE [dbo].[Order] WITH CHECK ADD CONSTRAINT [FK_Order_Address] FOREIGN KEY([addressID]) REFERENCES [dbo].[Address] ([addressID]) GO ALTER TABLE [dbo].[Order] CHECK CONSTRAINT [FK_Order_Address] GO /****** Object: ForeignKey [FK_Order_Customer] Script Date: 06/11/2012 18:41:11 ******/ ALTER TABLE [dbo].[Order] WITH CHECK ADD CONSTRAINT [FK_Order_Customer] FOREIGN KEY([customerID]) REFERENCES [dbo].[Customer] ([customerID]) GO ALTER TABLE [dbo].[Order] CHECK CONSTRAINT [FK_Order_Customer] GO /****** Object: ForeignKey [FK_Order_Tax] Script Date: 06/11/2012 18:41:11 ******/ ALTER TABLE [dbo].[Order] WITH CHECK ADD CONSTRAINT [FK_Order_Tax] FOREIGN KEY([taxID]) REFERENCES [dbo].[Tax] ([taxID]) GO ALTER TABLE [dbo].[Order] CHECK CONSTRAINT [FK_Order_Tax] GO /****** Object: ForeignKey [FK_Product_Component_Int_Component] Script Date: 06/11/2012 18:41:11 ******/

EMiX inc. Database System Development and Implementation Plan 17

ALTER TABLE [dbo].[Product_Component_Int] WITH CHECK ADD CONSTRAINT [FK_Product_Component_Int_Component] FOREIGN KEY([componentID]) REFERENCES [dbo].[Component] ([componentID]) GO ALTER TABLE [dbo].[Product_Component_Int] CHECK CONSTRAINT [FK_Product_Component_Int_Component] GO /****** Object: ForeignKey [FK_Product_Component_Int_Product] Script Date: 06/11/2012 18:41:11 ******/ ALTER TABLE [dbo].[Product_Component_Int] WITH CHECK ADD CONSTRAINT [FK_Product_Component_Int_Product] FOREIGN KEY([productID]) REFERENCES [dbo].[Product] ([productID]) GO ALTER TABLE [dbo].[Product_Component_Int] CHECK CONSTRAINT [FK_Product_Component_Int_Product] GO /****** Object: ForeignKey [FK_Order_Product_Int_Order] Script Date: 06/11/2012 18:41:11 ******/ ALTER TABLE [dbo].[Order_Product_Int] WITH CHECK ADD CONSTRAINT [FK_Order_Product_Int_Order] FOREIGN KEY([orderID]) REFERENCES [dbo].[Order] ([orderID]) GO ALTER TABLE [dbo].[Order_Product_Int] CHECK CONSTRAINT [FK_Order_Product_Int_Order] GO /****** Object: ForeignKey [FK_Order_Product_Int_Product] Script Date: 06/11/2012 18:41:11 ******/ ALTER TABLE [dbo].[Order_Product_Int] WITH CHECK ADD CONSTRAINT [FK_Order_Product_Int_Product] FOREIGN KEY([productID]) REFERENCES [dbo].[Product] ([productID]) GO ALTER TABLE [dbo].[Order_Product_Int] CHECK CONSTRAINT [FK_Order_Product_Int_Product] GO /****** Object: ForeignKey [FK_Backorder_Order] Script Date: 06/11/2012 18:41:11 ******/ ALTER TABLE [dbo].[Backorder] WITH CHECK ADD CONSTRAINT [FK_Backorder_Order] FOREIGN KEY([orderID]) REFERENCES [dbo].[Order] ([orderID]) GO ALTER TABLE [dbo].[Backorder] CHECK CONSTRAINT [FK_Backorder_Order] GO

Database manipulation scripts (DML)


DML that will be used to insert, delete, and update data in the proposed database system
INSERT INTO [EmixOnline].[dbo].[ZipCode] ([zip] ,[city] ,[state])

EMiX inc. Database System Development and Implementation Plan 18

VALUES

(<zip, int,> ,<city, nvarchar(50),> ,<state, nvarchar(50),>)

GO INSERT INTO [EmixOnline].[dbo].[Address] ([addressID] ,[type] ,[street] ,[city] ,[state] ,[customerID] ,[zip]) VALUES (<addressID, int,> ,<type, nchar(10),> ,<street, nvarchar(50),> ,<city, nvarchar(50),> ,<state, nvarchar(50),> ,<customerID, int,> ,<zip, int,>) GO INSERT INTO [EmixOnline].[dbo].[Backorder] ([backorderID] ,[quantity] ,[itemID] ,[orderID]) VALUES (<backorderID, int,> ,<quantity, int,> ,<itemID, int,> ,<orderID, int,>) GO INSERT INTO [EmixOnline].[dbo].[Payment_Method] ([payementMethodID] ,[type] ,[owner] ,[number] ,[expires] ,[cvv] ,[customerID]) VALUES (<payementMethodID, int,> ,<type, nchar(10),> ,<owner, nchar(10),> ,<number, int,> ,<expires, date,> ,<cvv, smallint,> ,<customerID, int,>) GO INSERT INTO [EmixOnline].[dbo].[Customer] ([customerID] ,[email]

EMiX inc. Database System Development and Implementation Plan 19

VALUES

,[password] ,[role] ,[firstName] ,[lastName] ,[phone] ,[dob] ,[fax] ,[companyName] ,[subscription]) (<customerID, int,> ,<email, nchar(10),> ,<password, nchar(10),> ,<role, nchar(10),> ,<firstName, nchar(10),> ,<lastName, nchar(10),> ,<phone, nchar(10),> ,<dob, date,> ,<fax, nchar(10),> ,<companyName, nchar(10),> ,<subscription, bit,>)

GO INSERT INTO [EmixOnline].[dbo].[Tax] ([taxID] ,[state] ,[percentage]) VALUES (<taxID, int,> ,<state, nchar(10),> ,<percentage, decimal(18,0),>) GO INSERT INTO [EmixOnline].[dbo].[Vender] ([venderID] ,[name] ,[address] ,[phone] ,[contact] ,[altPhone] ,[fax] ,[email] ,[accountNumber] ,[terms]) VALUES (<venderID, int,> ,<name, nchar(10),> ,<address, nvarchar(50),> ,<phone, nchar(10),> ,<contact, nchar(10),> ,<altPhone, nchar(10),> ,<fax, nchar(10),> ,<email, nvarchar(50),> ,<accountNumber, nchar(10),> ,<terms, nchar(10),>) GO

EMiX inc. Database System Development and Implementation Plan 20

INSERT INTO [EmixOnline].[dbo].[Component] ([componentID] ,[name] ,[cost] ,[quantityOnHand] ,[reorderPoint] ,[unitOfMeasure] ,[description] ,[venderID]) VALUES (<componentID, int,> ,<name, nchar(10),> ,<cost, money,> ,<quantityOnHand, int,> ,<reorderPoint, nchar(10),> ,<unitOfMeasure, nchar(10),> ,<description, nchar(10),> ,<venderID, int,>) GO INSERT INTO [EmixOnline].[dbo].[Product_Component_Int] ([componentID] ,[productID]) VALUES (<componentID, int,> ,<productID, int,>) GO INSERT INTO [EmixOnline].[dbo].[Product] ([productID] ,[name] ,[price] ,[weight] ,[quantityOnHand] ,[reorderPoint]) VALUES (<productID, int,> ,<name, nchar(10),> ,<price, money,> ,<weight, int,> ,<quantityOnHand, int,> ,<reorderPoint, nchar(10),>) GO INSERT INTO [EmixOnline].[dbo].[Order_Product_Int] ([quantity] ,[orderID] ,[productID]) VALUES (<quantity, int,> ,<orderID, int,> ,<productID, int,>) GO

EMiX inc. Database System Development and Implementation Plan 21

INSERT INTO [EmixOnline].[dbo].[Order] ([orderID] ,[dateOrdered] ,[dateShipped] ,[total] ,[tax] ,[taxID] ,[customerID] ,[addressID]) VALUES (<orderID, int,> ,<dateOrdered, date,> ,<dateShipped, date,> ,<total, money,> ,<tax, money,> ,<taxID, int,> ,<customerID, int,> ,<addressID, int,>) GO UPDATE [EmixOnline].[dbo].[ZipCode] SET [zip] = <zip, int,> ,[city] = <city, nvarchar(50),> ,[state] = <state, nvarchar(50),> WHERE <Search Conditions,,> GO UPDATE [EmixOnline].[dbo].[Vender] SET [venderID] = <venderID, int,> ,[name] = <name, nchar(10),> ,[address] = <address, nvarchar(50),> ,[phone] = <phone, nchar(10),> ,[contact] = <contact, nchar(10),> ,[altPhone] = <altPhone, nchar(10),> ,[fax] = <fax, nchar(10),> ,[email] = <email, nvarchar(50),> ,[accountNumber] = <accountNumber, nchar(10),> ,[terms] = <terms, nchar(10),> WHERE <Search Conditions,,> GO UPDATE [EmixOnline].[dbo].[Component] SET [componentID] = <componentID, int,> ,[name] = <name, nchar(10),> ,[cost] = <cost, money,> ,[quantityOnHand] = <quantityOnHand, int,> ,[reorderPoint] = <reorderPoint, nchar(10),> ,[unitOfMeasure] = <unitOfMeasure, nchar(10),> ,[description] = <description, nchar(10),> ,[venderID] = <venderID, int,> WHERE <Search Conditions,,> GO

EMiX inc. Database System Development and Implementation Plan 22

UPDATE [EmixOnline].[dbo].[Product_Component_Int] SET [componentID] = <componentID, int,> ,[productID] = <productID, int,> WHERE <Search Conditions,,> GO UPDATE [EmixOnline].[dbo].[Tax] SET [taxID] = <taxID, int,> ,[state] = <state, nchar(10),> ,[percentage] = <percentage, decimal(18,0),> WHERE <Search Conditions,,> GO UPDATE [EmixOnline].[dbo].[Product] SET [productID] = <productID, int,> ,[name] = <name, nchar(10),> ,[price] = <price, money,> ,[weight] = <weight, int,> ,[quantityOnHand] = <quantityOnHand, int,> ,[reorderPoint] = <reorderPoint, nchar(10),> WHERE <Search Conditions,,> GO UPDATE [EmixOnline].[dbo].[Order_Product_Int] SET [quantity] = <quantity, int,> ,[orderID] = <orderID, int,> ,[productID] = <productID, int,> WHERE <Search Conditions,,> GO UPDATE [EmixOnline].[dbo].[Order] SET [orderID] = <orderID, int,> ,[dateOrdered] = <dateOrdered, date,> ,[dateShipped] = <dateShipped, date,> ,[total] = <total, money,> ,[tax] = <tax, money,> ,[taxID] = <taxID, int,> ,[customerID] = <customerID, int,> ,[addressID] = <addressID, int,> WHERE <Search Conditions,,> GO UPDATE [EmixOnline].[dbo].[Customer] SET [customerID] = <customerID, int,> ,[email] = <email, nchar(10),> ,[password] = <password, nchar(10),> ,[role] = <role, nchar(10),> ,[firstName] = <firstName, nchar(10),> ,[lastName] = <lastName, nchar(10),>

EMiX inc. Database System Development and Implementation Plan 23

,[phone] = <phone, nchar(10),> ,[dob] = <dob, date,> ,[fax] = <fax, nchar(10),> ,[companyName] = <companyName, nchar(10),> ,[subscription] = <subscription, bit,> WHERE <Search Conditions,,> GO UPDATE [EmixOnline].[dbo].[Payment_Method] SET [payementMethodID] = <payementMethodID, int,> ,[type] = <type, nchar(10),> ,[owner] = <owner, nchar(10),> ,[number] = <number, int,> ,[expires] = <expires, date,> ,[cvv] = <cvv, smallint,> ,[customerID] = <customerID, int,> WHERE <Search Conditions,,> GO UPDATE [EmixOnline].[dbo].[Backorder] SET [backorderID] = <backorderID, int,> ,[quantity] = <quantity, int,> ,[itemID] = <itemID, int,> ,[orderID] = <orderID, int,> WHERE <Search Conditions,,> GO UPDATE [EmixOnline].[dbo].[Address] SET [addressID] = <addressID, int,> ,[type] = <type, nchar(10),> ,[street] = <street, nvarchar(50),> ,[city] = <city, nvarchar(50),> ,[state] = <state, nvarchar(50),> ,[customerID] = <customerID, int,> ,[zip] = <zip, int,> WHERE <Search Conditions,,> GO DELETE FROM [EmixOnline].[dbo].[Vender] WHERE <Search Conditions,,> GO DELETE FROM [EmixOnline].[dbo].[Component] WHERE <Search Conditions,,> GO DELETE FROM [EmixOnline].[dbo].[Product_Component_Int] WHERE <Search Conditions,,> GO

EMiX inc. Database System Development and Implementation Plan 24

DELETE FROM [EmixOnline].[dbo].[Tax] WHERE <Search Conditions,,> GO DELETE FROM [EmixOnline].[dbo].[Product] WHERE <Search Conditions,,> GO DELETE FROM [EmixOnline].[dbo].[Order_Product_Int] WHERE <Search Conditions,,> GO DELETE FROM [EmixOnline].[dbo].[Order] WHERE <Search Conditions,,> GO DELETE FROM [EmixOnline].[dbo].[Customer] WHERE <Search Conditions,,> GO DELETE FROM [EmixOnline].[dbo].[Payment_Method] WHERE <Search Conditions,,> GO DELETE FROM [EmixOnline].[dbo].[Backorder] WHERE <Search Conditions,,> GO DELETE FROM [EmixOnline].[dbo].[Address] WHERE <Search Conditions,,> GO DELETE FROM [EmixOnline].[dbo].[ZipCode] WHERE <Search Conditions,,> GO

SELECT statements
This will be used to read data from the proposed database system
SELECT [venderID] ,[name] ,[address] ,[phone] ,[contact] ,[altPhone]

EMiX inc. Database System Development and Implementation Plan 25

GO

,[fax] ,[email] ,[accountNumber] ,[terms] FROM [EmixOnline].[dbo].[Vender]

SELECT [componentID] ,[name] ,[cost] ,[quantityOnHand] ,[reorderPoint] ,[unitOfMeasure] ,[description] ,[venderID] FROM [EmixOnline].[dbo].[Component] GO SELECT [componentID] ,[productID] FROM [EmixOnline].[dbo].[Product_Component_Int] GO SELECT [taxID] ,[state] ,[percentage] FROM [EmixOnline].[dbo].[Tax] GO SELECT [productID] ,[name] ,[price] ,[weight] ,[quantityOnHand] ,[reorderPoint] FROM [EmixOnline].[dbo].[Product] GO SELECT [quantity] ,[orderID] ,[productID] FROM [EmixOnline].[dbo].[Order_Product_Int] GO SELECT [orderID] ,[dateOrdered] ,[dateShipped] ,[total] ,[tax] ,[taxID]

EMiX inc. Database System Development and Implementation Plan 26

GO

,[customerID] ,[addressID] FROM [EmixOnline].[dbo].[Order]

SELECT [customerID] ,[email] ,[password] ,[role] ,[firstName] ,[lastName] ,[phone] ,[dob] ,[fax] ,[companyName] ,[subscription] FROM [EmixOnline].[dbo].[Customer] GO SELECT [payementMethodID] ,[type] ,[owner] ,[number] ,[expires] ,[cvv] ,[customerID] FROM [EmixOnline].[dbo].[Payment_Method] GO SELECT [backorderID] ,[quantity] ,[itemID] ,[orderID] FROM [EmixOnline].[dbo].[Backorder] GO SELECT [addressID] ,[type] ,[street] ,[city] ,[state] ,[customerID] ,[zip] FROM [EmixOnline].[dbo].[Address] GO SELECT [zip] ,[city] ,[state] FROM [EmixOnline].[dbo].[ZipCode] GO

EMiX inc. Database System Development and Implementation Plan 27

Database Administration Plan


Transaction management
A transaction is a logical unit of work that contains one or more SQL statements; typically a transaction in a SQL DBMS begins when the first executable statement is encountered. When a transaction begins the DBMS assigns the transaction an available rollback segment. The transaction then ends when any of the following occurs: A Commit or Rollback statement is issued. A DDL statement e.g. CREATE, DROP etc. is executed. User disconnects from the Database. User abnormally terminates.

The strategy and processes the organization will follow for managing the transactions will be limited to the following: Which transactions are active and which sessions are running the transactions? Which transactions are doing the most work? Which Transactions are causing locking problems?

EMiX inc. Database System Development and Implementation Plan 28

The above essentially will make sure all long running transactions are monitored and locking and or blocking is avoided ("Transaction management ," ).

Database security procedure


Database Security procedures and policies come in a wide scope including backups which will be discussed later, ensuring unauthorized access to data is prohibited, we will discuss this policies below. System security policy: The database must have an administrator who is responsible for maintaining the aspects of the security policies. The Database security policy should include several sub-policies which include Database user management: Tight security should be maintained for the management of database users. Users Authentication: Database users can be authenticated by the DBMS using password, the operating system, and network services or by SSL. Operating System Security: The following must be considered for the operating system. DBAs must have the operating system privileges to create and delete. DB users should not have the privileges to create and or delete.

The organization should also explore the following essential security elements:
i.

Physical Security: Databases are run on machines that are vulnerable to attacks my hackers, viruses, spyware and disgruntled employees. Given that

EMiX inc. Database System Development and Implementation Plan 29

80% of security incidents are caused by insider threats. It is crucial to maintain physical protection of the computers e.g. locking rooms, strong passwords, and or biometric authentication.
ii.

Encryption: The organization should have a second line of defense against data theft. Encryption which scrambles data stored in a database according to a set of algorithms is highly encouraged. Administrators and users will be able to decrypt the information using a secret key.

iii.

Access Control: As discussed above access control prevents unauthorized users from viewing data that they are not supposed to see.

iv.

Log Monitoring: IDS (Intrusions detection systems) should be implemented to monitor access and deliver reports on potential malicious traffic

Backup and recovery


It is crucial to protect the data of the organization since it is the as termed the heart of the enterprise, this involves backup and recovery. This can protect against accidental loss of user data and database corruption, hardware failure and natural disasters. In order to avoid data loss the organization will need to figure out which data needs to be backed up and how often with the following considerations in mind: Importance of data Information contained in the data Frequency of data change How quick data recovery is needed.

EMiX inc. Database System Development and Implementation Plan 30

Backup equipment Responsibility of backup and recovery

The organization will use several techniques depending on the data being backed up these include:
i.

Normal/Full backups: All files that have been selected will be backed up regardless of the setting of the archives attributes.

ii.

Differential Backups: This is designed to create backup copies of files that have changed since the last normal backup.

iii.

Incremental backup: Designed to create backups of files that have changed since the most recent normal or incremental backup.

iv.

Daily backup: Designed to back up files using the modification date on the file itself.

Devices and media


Many tools are available in the market today for backing up data, some are fast and expensive others are slow but reliable depending on the following factors ("Chapter 14 data backup and recovery"):

Capacity: The amount of data that needs to be backed up. Reliable: Reliability of the backup hardware. Extensibility: The extensibility of the backup solution.

EMiX inc. Database System Development and Implementation Plan 31

Speed: Speed of which data can be backed up and recovered. Cost: The cost of the solution.

These solutions include Tape drives, DAT drives, Auto-loader tapes, Magnetic optical drives, disk drives and removable disks. Emix has chosen to back up the data in disk drives and online solutions that offer data backups.

Future Database System Implementation Plan


ER Model Conversion Description
The ER diagram was designed in a way to make the conversion from the diagram to a relationship modal very simple; the following was taken into account. A relationship model is made up of tables represented by a schema that contains A row which is represented by a relational instance A Column represented by an attribute Cardinality which is the number of rows and degree which are The number of columns

EMiX inc. Database System Development and Implementation Plan 32

The diagram above depicts the aspects of the ER diagram in relation to the tables. The following steps were taken to convert the diagram into tables I.
II.

A table was built for each entity set A table was built for each relationship set as the diagram below depicts

III. IV. V.

Make a column in the table for each attribute in the entity set Invisibility rule and ordering rule Primary key

EMiX inc. Database System Development and Implementation Plan 33

This being an online store it is worth noting that the database will support multi users i.e. more than one user will need to access the database at the same time, however modification of the database by the said users might cause integrity constraints. For example User A may try to change a table while user B is processing it. To take care of this problem an automatic concurrent use control will be implemented where.

The database is modified only at the end of a transaction users will not see the effects of an incomplete transaction Concurrent user interference will be resolved at the transaction level.

In detail several users will access a given table simultaneously; to prevent data corruption and preserve the integrity of the data SQL server will automatically control access by locking the table. After the given table is updated the server will automatically unlock it.

Modification Description
To keep the modification of the database consistently propagates in all the tables the organization will consider the database modification anomalies. The modification anomalies to be considered are as follows ("Modification anomalies", para. 8). Insertion Anomaly: This is a failure to insert data into a new database Deletion Anomaly: This is a failure to remove data from an existing database entry, when needed.

EMiX inc. Database System Development and Implementation Plan 34

Update Anomalies: This involves update failure for instance addition, deletion or both. These anomalies can be mitigated by properly normalizing a database, primary keys and foreign keys should be very well determined.

Query Performance Enhancement Strategy


Emix will consider indexes to improve performance in its database. For example an index on the Price column will be very beneficial for the queries below. DELETE FROM Products WHERE Price = 1 SELECT * FROM PRODUCTS WHERE Price BETWEEN 14 AND 16 A number of guidelines have been proposed in order to build effective indexes. Short keys: These are beneficial since larger indexes cause the database to perform more disk reads thus limiting throughput. Also in a comparison situation, smaller indexes prove easier to compare than larger ones. An integer is better used in this case rather than a string. Distinct Keys: The most effective indexes are those with a small percentage of duplicate values, for example in the customer database if the last name column contains a number of people named "smith" the chances of searching for a particular one would be very minimal unless we search using a customerID. Clustered index: Having one special index per table is called a clustered index. For this we already have primary keys for every table, these conform to Microsofts specifications for a clustered index. i.e.

EMiX inc. Database System Development and Implementation Plan 35

A column that contains distinct values Queries that return a range of values using operations e.g. BETWEEN, >, >=, < and <= Sequentially accessed columns Queries that return large data sets columns frequently accessed by queries involving join or Group BY

Changes Introduced To the Database Data Mart or Data warehouse


The current database holds information to perform the organizations business activities. Creating a data mart or a data warehouse would bring value to the organization by being able to analyze historical data thus discovering patterns of behavior and predicting future trends. For instance; in our case the historical data will be able to identify what products were bought in what quantity and by which customers ("Designing a data", para. 1). Bringing together the current and historical data from multiple databases makes up a data warehouse; although bringing so much of the data makes analysis difficult thus the need to implement a data mart. These are related sets of data that are grouped together and separated out from the main data body. For instance data about a product and a component can be put in a separate data mart and made available to the production department, Customer data and customer address data can be put together

EMiX inc. Database System Development and Implementation Plan 36

and provided to the magazine subscriptions department if need be, making it easier to access only specific data at a given time. These said the organization will need to create a copy of the existing database and name it "historical_" this will then be integrated into the warehouse. An extraction tool will also be needed to extract historical data to the history database (the organization will need to decide what makes data historical, what length of time) Steps have been made to expand the current table structure to contain data marts.

Distributed Database
Distribute database systems are needed in situations where data and its access are inherently distributed and also to increase availability during failures. Thus if need arises for such a system replication of the database and its data will need to occur and copied in different servers, special care must be taken when updating the databases such that the data remains the same.

References
7 Security Poliices." . N.p., n.d. Web. 18 Jun 2012. <http://docs.oracle.com/cd/B12037_01/network.101/b10773/policies.htm>. About puget systems . (2011). Retrieved from http://www.pugetsystems.com/aboutus.php "Data Backup and Recovery." Chapter 14 - data backup and recovery. Technet, 2011. Web. 18 Jun 2012. <http://technet.microsoft.com/enus/library/bb727106.asp&xgt;. Designing a data warehouse. (n.d.). Retrieved from http://msdn.microsoft.com/enus/

EMiX inc. Database System Development and Implementation Plan 37

library/aa906003(v=sql.80).aspx

Modification anomalies. (n.d.). Retrieved from http://classes.midlandstech.edu/cpt242/MODIFICATION_ANOMALIES.HTML Transaction management . (n.d.). Retrieved from http://www.csee.umbc.edu/portal/help/oracle8/server.815/a67781/c15trans.htm

Vous aimerez peut-être aussi