Documente Academic
Documente Profesional
Documente Cultură
IDA-MS-TD
Issue 1
TABLE OF CONTENTS
1 INTRODUCTION ........................................................................................................1
1.1 Purpose ....................................................................................................................1
1.2 Scope ........................................................................................................................1
1.3 Definitions, Acronyms and Abbreviations ...........................................................1
1.4 References ...............................................................................................................2
1.5 Overview .................................................................................................................2
2 SYSTEM DESIGN .......................................................................................................3
2.1 System Context .......................................................................................................3
2.2 System Characteristics ...........................................................................................4
2.3 System Architecture ...............................................................................................4
2.4 Infrastructure Services ..........................................................................................7
2.5 Design Method and Standards ..............................................................................7
2.6 Programming Standards .....................................................................................10
2.7 Database diagram.................................................................................................12
2.8 Program evidences ...............................................................................................13
IDA-MS-TD
Issue 1
1 INTRODUCTION
1.1 PURPOSE
1.2 SCOPE
a. Develop a Relational Database System to store and protect the data of a store
b. This system will store the store’s necessary data, which are:
• Customer Information
• Seller (Employee) Information
• Product & Provider Information
• Invoice Information
IDA-MS-TD
Issue 1
• FK:Foreign Key
b) Abbreviations:
1.4 REFERENCES
1.5 OVERVIEW
/1 This project was made in order to develop a Relational Database based on Microsoft
SQL Server. Acknowledged by using information from … (reference documents).
/2 This Database consists of 6 Entities and 25 Attributes in total.
/3 System context:
ElectroShop is a store who have been using Flat File Database to save all of their data,
acknowledging the shortness of this method, this Relational Database system will be a
better method to store their data.
/4 System design method:
• Using Arrow.io Application to draw the detailed Logical Design of
ElectroShop’s Database
• Develop the Physical Design and also functioned on Microsoft SQL Server
Management Studio 17.
Technical Design Document Page 3
IDA-MS-TD
Issue 1
2 SYSTEM DESIGN
IDA-MS-TD
Issue 1
Every Invoice has two copies, one will be given to the customer when they finish
purchasing, one will get stored by tagged in the store’s bills-notebook. Customer
Information that included in each Invoice will be stored in a different notebook-
Customer Information. They also have another notebook to store information about
the products that they have and information of their suppliers. To store information
of their Sellers, they also have a notebook for it.
But, after an amount of time, amount of information about customers and products
became too much to handle, the system needs to be expanded. If they keep using
the Notebook method, they will find it hard to control their database such as harder
to find, to make changes on the information, ...
a) Normalization Process:
Acknowledged ElectroShop’s requirements by information that they give, this
system will be designed with 6 Entities and 25 Attributes in total. But to get to
that, information needs to get through the Normalization process bellow in order
to get rid of repeating or anomaly data:
Technical Design Document Page 5
IDA-MS-TD
Issue 1
Supplier ID
Supplier Name
Supplier Address
Supplier Phone
IDA-MS-TD
Issue 1
IDA-MS-TD
Issue 1
By dividing the data-sources into different parts (tables), this System will provide:
• Data filter: Input data will be filtered to avoid data redundancy before
being able to join the Database. For Example, information of one
Customer will never be able to be added into the Database multiple times.
• Data Modification: Out-of-date data or wrong data could be modified easily
(For authorized person only). In such cases, if the data is changed at one
place, the change has to be duplicated in each of the files where it’s related
to or referenced from.
• Security: Features like multiple views offer security to some extent
where users are unable to access data of other users and departments.
IDA-MS-TD
Issue 1
• Seller_Information table:
This table is used to store all information about ElectroShop’s seller. It has 6
columns such as: SellerID, Seller_Name, Seller_Date_of_Birth,
Seller_Gender, Seller_Address and Seller_Phone. Among these, SellerID is
the Primary key.
Every column in this table are not allowed to be null. Seller_Gender must
be checked between “male” or “female”. In details, this table can be shown
as follow:
Column name Data Type Allow Constraint
null
SellerID nvarchar(10) no PK
Seller_Name nvarchar(100) no
Seller_Date_of_Birth Date no
Seller_Gender nvarchar(10) no Check(Seller_Gender=’male’
OR Seller_Gender=‘female’)
Seller_Address nvarchar(500) no
Seller_Phone Int no Unique
• Bill_Information table:
This table is used to store the main basic information of ElectroShop’s invoice. It
has 4 columns such as: BillID, SellerID, CustomerID and Date_of_bill. Among
these, BillID is the Primary key. This table also having SellerID and CustomerID
as Foreign keys, which referenced from Seller_Information table and
Customer_Information table. In details, this table can be shown as follow:
Technical Design Document Page 9
IDA-MS-TD
Issue 1
• Bill_Details table:
This table is used to store detailed information of ElectroShop’s invoice. It has 4
columns such as: BillID, ProductID, Sold_Quantity, Selling_Price. Among these,
BillID and ProductID are Primary Keys, at the same time, they are also Foreign
Keys referenced from Bill_Information table and Product_Information table.
Except of Bonus_for_Seller is available for null, every other column will not be
allowed for any null. Sold_Quantity and Selling_Price needs to check to make
sure it’s larger than zero (>0). In details, this table can be shown as follow:
• Product_Information table:
This table is used to store detailed information of ElectroShop’s product. It has 6
columns such as: ProductID, SupplierID, Product_Name, Calculation_Unit, Price
and In_Stock_Quantity. Among these, ProductID is the Primary Key and
SupplierID as Foreign Key which referenced from Supplier_Information table.
In_Stock_Quantity must be larger or at least equals 0. Product_Name and Price
are not being able for null and Calculation_Unit has a default as “pc(s)”. Price are
not able to smaller than 0. In details, this table can be shown as follow:
IDA-MS-TD
Issue 1
• Supplier_Information table:
This table is used to store information of ElectroShop’s supplier. It has 4
columns such as: SupplierID, Supplier_name, Supplier_address and
Supplier_phone. Among these, SupplierID is the Primary Key. Supplier_name
and Supplier_address are not allowed to be null, also, Supplier_phone have to be
unique. In details, this table can be shown as follow:
This section will contain detailed instructions for the Database completion by
declaring the Query codes made with Microsoft SQL Server Management Studio.
In details:
First up, the Database must be created:
create database ElectroShop_Database;
After finishing the Database creation step, tables and its entities (columns) must
be created, which are:
• Supplier_Information table:
• Customer_Information table:
Technical Design Document Page 11
IDA-MS-TD
Issue 1
• Seller_Information table:
• Bill_Information table:
create table Bill_Information(
BillID nvarchar(10) Primary key,
SellerID nvarchar(10) Foreign key references
Seller_Information(SellerID) on update cascade
on delete cascade not null,
CustomerID nvarchar(10) Foreign key references
Customer_Information(CustomerID) on update
cascade on delete cascade not null,
Date_of_bill datetime default(getdate()));
• Product_Information table:
IDA-MS-TD
Issue 1
Calculation_Unit nvarchar(50)
default('pc(s)'),
Price money not null check(Price>0),
In_Stock_Quantity int check(In_Stock_Quantity>=0)
not null);
• Bill_Details table:
IDA-MS-TD
Issue 1
• Seller_Information table:
• Bill_Information table:
• Bill_Details table:
Technical Design Document Page 14
IDA-MS-TD
Issue 1
• Product_Information table:
• Supplier_Information table:
Technical Design Document Page 15
IDA-MS-TD
Issue 1
b) Database views:
• This view is to declare detailed information of each bill which include BillID,
name of the product with its selling price, calculation unit, amount of device
that got sold and total price (by multiplying Sold_Quantity and Selling_Price):
IDA-MS-TD
Issue 1
IDA-MS-TD
Issue 1
IDA-MS-TD
Issue 1
IDA-MS-TD
Issue 1
IDA-MS-TD
Issue 1
(N'SPID02', N'FPT Shop ', N'12 Pasteur, 1st district, HCM city',
968686868),
(N'SPID03', N'The Gioi Di Dong', N'300 Bach Dang, Hai Chau district,
Da Nang city', 909123456),
IDA-MS-TD
Issue 1
IDA-MS-TD
Issue 1
IDA-MS-TD
Issue 1
/1 View 1 Query:
/2 View 2 Query:
/3 View 3 Query:
/4 View 4 Query:
/5 View 5 Query:
Technical Design Document Page 24
IDA-MS-TD
Issue 1
• This Select Query will identify Customers who have been purchasing
for ElectroShop’s product more than once:
• This Select Query will show Top 3 Product that got purchased the most:
IDA-MS-TD
Issue 1
• This Select Query will indicate the amount of product’s type that got supplied
by each Supplier:
• This Select Query will indicate the amount of profit that ElectroShop gets
in each bill.
To get this Query, another View must be created to indicate the total cost
based on original price for each bill:
IDA-MS-TD
Issue 1
Then, based on the newly-created view (as view 6) and view 1 (which indicated the
total cost based on selling price), this Query will indicate the profit that ElectroShop
will get in each product from each bill by subtracting the Total (Selling price) and Total
(Original price) and save the results as another view named view 7:
After completing view 7, this Query will indicate ElectroShop’s total profit
in each month of each year:
IDA-MS-TD
Issue 1