You are on page 1of 23

ASSIGNMENT FRONT SHEET <No.

1>

Qualification BTEC Level 5 HND Diploma in Computing and Systems Development

Unit number and title Unit 04: Database Design & Development

Assignment due 26/7/2019 Assignment submitted 3/8/2019

Learner’s name Do Vu Hoang Anh Assessor name Nguyen Thai Cuong

Learner’s ID BHAF190004 Submission number

Learner declaration:
I certify that the work submitted for this assignment is my own and research sources are fully acknowledged.

Learner signature Anh Date

Grading grid

P1 M1 D1

Assignment title Understand databases and data management systems

In this assignment, you will have opportunities to provide evidence against the following criteria.
Indicate the page numbers where the evidence can be found.

Assessment criteria Expected evidence Task Assessor’s Feedback


no.

LO1 Use an appropriate design tool to design a relational database system for a substantial problem

P1 Design a relational
database system using
- An ERD clearly shows the complete
appropriate design tools logical design for the given scenario
and techniques, containing 1
at least four interrelated - Write the normalization statement
for each of the entity
tables, with clear
statements of user and
system requirements.

M1 Produce a
comprehensive design for a
- Comprehensive design for a
fully functional system
fully functional system 1
which includes interface
- Data validations and data
and output designs, data
normalisation
validations and data
normalisation.
D1 Assess the effectiveness of
the design in relation to user 1
and system requirements.
Contents
I. Introduction..............................................................................................................................................................6
II. Basic Concept.........................................................................................................................................................6
1.1 Table..................................................................................................................................................................6
1.1.1 Row............................................................................................................................................................6
1.1.2 Column.......................................................................................................................................................6
1.1.3 DataTypes...................................................................................................................................................6
1.2 Concept of Database..........................................................................................................................................7
1.2.1 Database.....................................................................................................................................................7
1.2.2 Database management system (DBMS)......................................................................................................7
1.2.3 RelationShips..............................................................................................................................................7
1.3 Definition of ERD.............................................................................................................................................8
III. Normalization........................................................................................................................................................8
2.1 First normalization.............................................................................................................................................8
2.2 Second normalization........................................................................................................................................8
2.3 Third normalization...........................................................................................................................................9
IV. Design................................................................................................................................................................. 10
3.1 Assignment brief..............................................................................................................................................10
3.2 ERD.................................................................................................................................................................12
3.3 SQL server design...........................................................................................................................................13
3.3.1 Customer table..........................................................................................................................................13
3.3.2 Supplier table............................................................................................................................................13
3.3.3 Product table.............................................................................................................................................14
3.3.4 PurchaseOrder table..................................................................................................................................14
3.3.5 OrderProduct table....................................................................................................................................14
3.3.6 Employee Table........................................................................................................................................15
4. Database diagram..................................................................................................................................................16
V. Conclusion............................................................................................................................................................16
Reference................................................................................................................................................................... 16
I. Introduction
In this assignment I am going to Design a relational database system and introduce about three
normalization

II. Basic Concept


1.1 Table
Tables are database objects that contain all the data in a database. In tables, data is logically
organized in a row-and-column format similar to a spreadsheet. Each row represents a unique
record, and each column represents a field in the record. For example, a table that contains
employee data for a company might contain a row for each employee and columns representing
employee information such as employee number, name, address, job title, and home telephone
number.

1.1.1 Row
The term ‘row’, represent an arrangement, wherein people, objects, numbers or any other things
lie next to each other, facing the same way, i.e. in a horizontal line. It goes from left to right, like
the row of a school classroom, or seats of a movie theatre.

1.1.2 Column
A column is an arrangement of facts, figures, words, etc. , are placed one after another in a
sequence. In a table, columns are separated from each other by lines which enhance its readability
and attractiveness. It helps in making the comparison between two columns by placing them side
by side.

1.1.3 DataTypes
A data type, in programming, is a classification that specifies which type of value a variable has
and what type of mathematical, relational or logical operations can be applied to it without
causing an error. A string, for example, is a data type that is used to classify text and an integer is
a data type used to classify whole numbers.

Example

INT(size): A medium integer. Signed range is from -2147483648 to 2147483647. Unsigned range
is from 0 to 4294967295. The size parameter specifies the maximum display width (which is 255)
TEXT(size): Holds a string with a maximum length of 65,535 bytes

1.2 Concept of Database


1.2.1 Database
A database is an organized collection of structured information, or data, typically stored
electronically in a computer system. A database is usually controlled by a database
management system (DBMS). Together, the data and the DBMS, along with the applications
that are associated with them, are referred to as a database system, often shortened to just
database.
Data within the most common types of databases in operation today is typically modeled in
rows and columns in a series of tables to make processing and data querying efficient. The
data can then be easily accessed, managed, modified, updated, controlled, and organized. Most
databases use structured query language (SQL) for writing and querying data.

1.2.2 Database management system (DBMS)


Definition - What does Database Management System (DBMS) mean?

A database management system (DBMS) is a software package designed to define, manipulate,


retrieve and manage data in a database. A DBMS generally manipulates the data itself, the data
format, field names, record structure and file structure. It also defines rules to validate and
manipulate this data. A DBMS relieves users of framing programs for data maintenance. Fourth-
generation query languages, such as SQL, are used along with the DBMS package to interact with
a database.

Some other DBMS examples include:

MySQL
SQL Server

Oracle

1.2.3 RelationShips
A relationship, in the context of databases, is a situation that exists between two relational
database tables when one table has a foreign key that references the primary key of the other table.
Relationships allow relational databases to split and store data in different tables, while linking
disparate data items.

1.3 Definition of ERD


An entity-relationship diagram (ERD) is a data modeling technique that graphically illustrates an
information system’s entities and the relationships between those entities. An ERD is a conceptual
and representational model of data used to represent the entity framework infrastructure.
III. Normalization
2.1 First normalization
Relationship is in the first normalization form if all attribute domains are single domains and no
repeating attribute group exists

Example:

Figure 1: First Normalization

2.2 Second normalization


Relation in the normal form 2 if it is already in first normal form and does not exist a functional
dependency on the key. Relationships with keys are an attribute that is always in second
normalization

Example:
Figure 2: Second Normalization

2.3 Third normalization


Relation in the third normalization if it is already in the second normalization and does not exist
the function of bridging functions into the key (or the function dependency between the non-
locked attributes

Example :

Figure 3: Third Normalization

IV. Design
3.1 Assignment brief
ElectroShop is a company who acquire and sell electronic devices to customers throughout
Vietnam. They are looking to apply their current data store system with a relational database.

The company takes orders from customers, who can order any quantity of many items that
ElectroShop have in their current catalogue. The catalogue includes TV, Phone, etc.
Each of ElectroShop’s suppliers supplies many items but each item is supplied by one main
supplier.

ElectroShop would like to add all the customers to the database so that they can send a mail-shot
to them with any offers that are available, as well as the catalogue which is produced annually.

Salespersons at ElectroShop are paid a monthly bonus which is determined by the amount of sales
they have made for each month. The company would like the bonus calculated automatically by
the system.

As well as the monthly bonus figures ElectroShop would like to be able to create comparative
reports from the system i.e. sales figures for each month this year compared to last year.

From the above requirement we have seven table:

Customer table include: CustomerID, Name, Address, Phone.

Product table include : ProductID, SupplierID, ProductName.

Supplier table include: SupplierID, SupplierName, SupplierPhone.

Perchase_Order include: OrderID, CustomerID, Date, Total.

Order_Product table include: OrderID, ProductID, Quantity.

Employee table include: EmployeeNo, Date_Of_Birth, FirstName, LastName, Gender, HireDate.

Salary table include: EmployeeNo, Salary, FromDate, ToDate.

3.2 ERD

ERD diagram above is in Third normalization form because:

- Attribute domains are single domains and no repeating attribute group exists
- Does not exist a functional dependency on the key

- does not exist the function of bridging functions into the key (or the function dependency
between the non-locked attributes

Figure 4: ERD

3.3 SQL server design


3.3.1 Customer table

ColumnName DataType Constraint Description


CustomerID Varchar(10) Primary key ID of customer
Name Varchar(50) Not null Name of customer
Address Varchar(100) Not null Address of customer
Gender Char(1) Sex
Date_of_birth Date Birthday of customer
3.3.2 Supplier table

ColumnName DataType Constraint Description


SupplierID Varchar(10) Primary key ID of Supplier
Name Varchar(50) Not null Name of Supplier
Phone Text Not null Phone of Supplier
3.3.3 Product table

ColumnName DataType Constraint Description


ProductID Varchar(10) Primary key, not null ID of Product
SupplierID Varchar(10) Foreign key, not null ID of Supplier
Name Varchar(50) Not null Name of Product
3.3.4 PurchaseOrder table

ColumnName DataType Constraint Description

OrderID Varchar(10) Primary key, not null ID of Order


CustomerID Varchar(10) Foreign key, not null ID of Customer
Date Date Not null Date of Order
Total Int Not null Total of Order
3.3.5 OrderProduct table
ColumnName DataType Constraint Description
OrderID Varchar(10) Primary key, foreign key, ID of Order
not null
ProductID Varchar(10) Primary key, foreing key, ID of Product
not null
Quantity Int Not null Quantity of Product

3.3.6 Employee Table


ColumnName DataType Constraint Description
EmployeeNo Varchar(10) Primary key, not null Number of Employee
Birth_Date Date Birthday of Employee
FirstName Varchar(50) Not null Firstname of Employee
LastName Varchar(50) Not null Lastname of Employee
Gender Char Sex of Employee
HireDate Date Not null HireDate of Employee
3.3.7 Salary table

ColumnName DataType Constraint Description


TotalSalary Int Primary key, not null Salary of Employee
Shift Int Not null Shift of Employee
Bonus Int Bonus of Employee
Salary Int Not null Salary of Employee
EmployeeNo Int Foreign key, not null Number of Employee
4. Database diagram
V. Conclusion
In the above reports, I have presented the following main ideas:

- What are table and concept of database


- Introduce three normalization we usually use
- Design Erd and database diagram about assignment brief

Reference
https://www.techopedia.com

https://www.oracle.com

https://beginnersbook.com
<ATTACHED EVIDENCE>

You might also like