You are on page 1of 20

ASSIGNMENT 2 FRONT SHEET

Qualification TEC Level 5 HND Diploma in Computing

Unit number and title Unit 04: Database Design & Development

Submission date Date Received 1st submission

Re-submission Date Date Received 2nd submission

Student Name Le Duc Anh Student ID GCS18856

Class GCS0801B.1 Assessor name

Student declaration

I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand that
making a false declaration is a form of malpractice.

Student’s signature

Grading grid

P2 P3 P4 P5 M2 M3 M4 M5 D2 D3

1
❒ Summative Feedback: ❒ Resubmission Feedback:

Contents
P2 Develop the
database system
with evidence of
user interface,
output and data
validations, and
querying across
multiple tables.

P3 Implement a
query language into
the relational
database system.

P4 Test the system


against user and
system
requirements.

Grade: Assessor Signature: Date: P5 Produce


Signature & Date: technical and user
documentation.

2
P2 Develop the database system with evidence of user interface, output and data validations, and querying across
multiple tables.

1. Create databases and test them.

 So I analyzed to show everyone what my Salary system had and now I will create them using an SQL program called SQL Server
Managements Studio (SSMS)

1.1 Create databases

3
Database of SALARY SYSTEM created

1.2. The tables of Salary.

Assigned table

Customer table

4
Product table

Revenue table

Salary table

5
Staff table

1.3. Value for each table

Assigned table values

Customer table values


6
Product table values

Revenue table values

Salary table values

7
Staff table values

2. Check if the results work


 Now I will call up a few tables with the command to see what its output looks like.

8
select * from Customer
3. Salary database with 6 tables can be queried on multiple tables using T-SQL.

 Now I will query some tables to see if they can connect to each other:

Query 1: The first question is if I will check to see if the workplace matches the employee's hometown.

P3 Implement a query language into the relational database system.

9
1. Database is run by code:

 So I have shown everyone about my table design and now I will show people how I create those tables using lines in SSMS.

Create table Staff ([Staff name] nvarchar (30) primary key not null, [Num at] int, age int, [home
town] nvarchar (MAX) not null);
Create table Revenue ([Work place] nvarchar (50) primary key not null, [Staff name] nvarchar (30)
not null, [Target] int);
Create table Assigned ([Num at] int primary key, [Work] nvarchar (50) not null, [Work place]
nvarchar (50) not null);
Create table Customer ([Staff name] nvarchar (30) primary key not null, Customer nvarchar (30) not
null, [ID Product] int, [Money bonus] money);
Create table Product ([ID Product] int primary key, Product nvarchar (50));
Create table Salary ([Num at] int primary key, [Target] int, [Salary] money, [Money bonus] money);

 And those lines of code to create tables like the ones we've seen above now add value.

2. Add values to the table:

 Here's what I did to add value to the table.

use [SALARY SYSTEM]


insert into Staff values
('Long Kim Tran',1,'TP. Ho Chi Minh',20),
('Phuc Trinh Ngoc',2,'Dong Nai',20),
('Nghia Tran',3,'TP. Ho Chi Minh',19),
('Tuan Nguyen',4,'London',22),
('Hieu Le',5,'Phan Thiet',22);
insert into Salary values
(1,500000,6000000,500000),
(2,200000,6000000,500000),
(3,400000,6000000,500000),
(4,500000,6000000,500000),
(5,500000,6000000,500000);
10
insert into Revenue values
('102 Nguyen Xi','Long Kim Tran',500000),
('52 Ly Tu Trong','Phuc Trinh Ngoc',200000),
('624 Le Hong Phong','Nghia Tran',400000),
('2 Hai Ba Trung','Tuan Nguyen',500000),
('502 Duong Quang Ham','Hieu Le',500000);
insert into Product values
(1811,'Apple pen'),
(0805,'Pineapple pen'),
(2510,'Three chicken'),
(1706,'Mixi food');
insert into Customer values
('Long Kim Tran','Anh Duy',0805,500000),
('Phuc Trinh Ngoc','Bill Noy',2510,200000),
('Tuan Nguyen','Miu Miu',1706,500000),
('Nghia Tran','Teacher Three',2510,400000),
('Hieu Le','Duc Anh',1811,500000);
insert into Assigned values
(1,'Saler','102 Nguyen Xi'),
(2,'Cashier','52 Ly Tu Trong'),
(3,'Saler','624 Le Hong Phong'),
(4,'Shipper','2 Hai Ba Trung'),
(5,'Cashier','502 Duong Quang Ham');

P4 Test the system against user and system requirements.

 Now I will check the requests that the user originally requested.

1. The system of employees in the store and the company has quite a lot of employees, which will have the employee's name,
age and hometown.

11
select * from Customer

2. The assignment of the employees to the place is because each employee can work together or individually depending on the
arrangement of the company so what job and where will it work?

12
select S.[Num at],A.[Work],A.[Work place]
from Staff S join Assigned A
on S.[Num at]=A.[Num at];
3. For the product, it must have the code and name of the product to be sold to customers.

13
select C.[ID Product], P.[Product]
from Customer C join Product P
on C.[ID Product]=P.[ID Product];

4. Customers are the company's top priority so customers must purchase the product code and bonus for employees.

14
use [SALARY SYSTEM]

15
select C.[Customer], S.[Staff name], M.[Money bonus], P.[Product]
from Customer C join Staff S
on S.[Staff name]=C.[Staff name]
join Salary M
on M.[Money bonus]=C.[Money bonus]
join Product P
on C.[ID Product]=P.[ID Product];

5. Sales will be reported when employees are given their jobs including where they work and that revenue target.

use [SALARY SYSTEM]


select S.[Staff name], T.[Target], Wl.[Work place]
from Revenue T join Staff S
on S.[Staff name]=T.[Staff name]
join Assigned Wl
on Wl.[Work place]=T.[Work place];

16
6. And finally, the salary will be distributed when the revenue is reported and the salary will be calculated based on the
employee's goals and bonuses.

use [SALARY SYSTEM]


select C.[Money bonus],S.[Num at],R.[Target],Sa.[Salary]
from Salary Sa join Staff S
17
on S.[Num at]=Sa.[Num at]
join Revenue R
on R.[Target]=Sa.[Target]
join Customer C
on C.[Money bonus]=Sa.[Money bonus];

P5 Produce technical and user documentation.

 Under the conditions above there are things that need to be stored and recorded.

1. Database structure:

 The structure of an interface that makes databases based on the language that it is programmed as my code.

Create table Staff ([Staff name] nvarchar (30) primary key not null, [Num at] int, age int, [home
town] nvarchar (MAX) not null);
Create table Revenue ([Work place] nvarchar (50) primary key not null, [Staff name] nvarchar (30)
not null, [Target] int);
Create table Assigned ([Num at] int primary key, [Work] nvarchar (50) not null, [Work place]
nvarchar (50) not null);
Create table Customer ([Staff name] nvarchar (30) primary key not null, Customer nvarchar (30) not
null, [ID Product] int, [Money bonus] money);
Create table Product ([ID Product] int primary key, Product nvarchar (50));
Create table Salary ([Num at] int primary key, [Target] int, [Salary] money, [Money bonus] money);

2. Database development process.

 The database development process all depends on the values you add inside it, just like the values I added inside of a table.

use [SALARY SYSTEM]


insert into Staff values
('Long Kim Tran',1,'TP. Ho Chi Minh',20),
('Phuc Trinh Ngoc',2,'Dong Nai',20),
('Nghia Tran',3,'TP. Ho Chi Minh',19),
18
('Tuan Nguyen',4,'London',22),
('Hieu Le',5,'Phan Thiet',22);
insert into Salary values
(1,500000,6000000,500000),
(2,200000,6000000,500000),
(3,400000,6000000,500000),
(4,500000,6000000,500000),
(5,500000,6000000,500000);
insert into Revenue values
('102 Nguyen Xi','Long Kim Tran',500000),
('52 Ly Tu Trong','Phuc Trinh Ngoc',200000),
('624 Le Hong Phong','Nghia Tran',400000),
('2 Hai Ba Trung','Tuan Nguyen',500000),
('502 Duong Quang Ham','Hieu Le',500000);
insert into Product values
(1811,'Apple pen'),
(0805,'Pineapple pen'),
(2510,'Three chicken'),
(1706,'Mixi food');
insert into Customer values
('Long Kim Tran','Anh Duy',0805,500000),
('Phuc Trinh Ngoc','Bill Noy',2510,200000),
('Tuan Nguyen','Miu Miu',1706,500000),
('Nghia Tran','Teacher Three',2510,400000),
('Hieu Le','Duc Anh',1811,500000);
insert into Assigned values
(1,'Saler','102 Nguyen Xi'),
(2,'Cashier','52 Ly Tu Trong'),
(3,'Saler','624 Le Hong Phong'),
(4,'Shipper','2 Hai Ba Trung'),
(5,'Cashier','502 Duong Quang Ham');

19
References:

Resource, B. and Resource, B., 2020. Kiến Thức, Kinh Nghiệm, Tài Liệu Quản Trị Doanh Nghiệp Cho Kỷ Nguyên Số - 10000+ Subscribers - Base
Resources. [online] Resources.base.vn. Available at: <https://resources.base.vn/hr/cach-trien-khai-he-thong-luong-3p-cach-
tinhluongcho-nhan-vien-chinh-xac-nhat-358> [Accessed 11 March 2020].

Symplefy. 2020. 10 Mô Hình Quản Lý Nhân Sự Hiệu Quả Nhất Hiện Nay | Symplefy. [online] Available at:
<https://www.symplefy.com/vi/mo-hinh-quan-ly-nhan-su-hieu-qua/> [Accessed 11 March 2020].

Bravo.com.vn. 2020. Các Mô Hình Quản Lý Nhân Sự Trong Doanh Nghiệp Cơ Bản Nhất Hiện Nay. [online] Available at:
<https://www.bravo.com.vn/vi/Tin-tuc/Quan-tri-doanh-nghiep/Cac-mo-hinh-quan-ly-nhan-su-trong-doanh-nghiep-co-ban-nhat-hien-
nay> [Accessed 11 March 2020].

Phần mềm Quản lý Doanh nghiệp & Cộng tác trực tuyến thời gian thực mọi lúc, mọi nơi. 2020. Mô Hình Quản Lý Nhân Sự Nào Phổ Biến
Hiện Nay? - Phần Mềm Quản Lý Doanh Nghiệp & Cộng Tác Trực Tuyến Thời Gian Thực Mọi Lúc, Mọi Nơi. [online] Available at:
<https://www.ihcm.vn/tin-tuc/tin-tuc/quan-tri-doanh-nghiep/1397-mo-hinh-quan-ly-nhan-su-nao-pho-bien-hien-nay.html> [Accessed 11
March 2020].

Doanh Nhân Sài Gòn Online. 2020. 2 Mô Hình Quản Lý Nhân Sự Phổ Biến. [online] Available at: <https://doanhnhansaigon.vn/goc-nha-
quan-tri/2-mo-hinh-quan-ly-nhan-su-pho-bien-1062875.html> [Accessed 11 March 2020].

Eduviet. 2020. Các Mô Hình Quản Lý Nhân Lực - Eduviet. [online] Available at: <http://eduviet.vn/tin-tuc/cac-mo-hinh-quan-ly-nhan-
luc.html> [Accessed 11 March 2020].

Viện Kế toán và Quản trị Doanh nghiệp. 2020. [online] Available at: <https://iabm.edu.vn/ba-mo-hinh-quan-tri-nhan-su-thanh-cong-ma-
cac-nha-quan-ly-can-tham-khao.html> [Accessed 11 March 2020].

2020. [online] Available at: <https://www.thuatngumarketing.com/database-management-system-viet-tat-dbms/> [Accessed 11 March


2020].

 2020. [online] Available at: <http://www.ddegjust.ac.in/studymaterial/mca-3/ms-11.pdf> [Accessed 11 March 2020].

20

You might also like