Académique Documents
Professionnel Documents
Culture Documents
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
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
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.
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
Shopping Cart
Customer adds products to purchase to shopping cart.
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.
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 must be secure Customer Must be able to add products to shopping cart Customer personal information must be captured Customer must provide Shipping address
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)
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
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)
Address
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
[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]
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]
) 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,
[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])
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 ******/
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
VALUES
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]
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
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
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
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),>
,[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
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]
GO
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]
GO
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
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?
The above essentially will make sure all long running transactions are monitored and locking and or blocking is avoided ("Transaction management ," ).
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
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
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.
Capacity: The amount of data that needs to be backed up. Reliable: Reliability of the backup hardware. Extensibility: The extensibility of the backup solution.
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.
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
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.
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.
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
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/
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