P.1 Design A Relational Database System Using Appropriate Design Tools and Techniques, Containing at Least Four Interrelated
P.1 Design A Relational Database System Using Appropriate Design Tools and Techniques, Containing at Least Four Interrelated
P.1 Design A Relational Database System Using Appropriate Design Tools and Techniques, Containing at Least Four Interrelated
P.1 Design a relational database system using appropriate design tools and techniques, containing at least four interrelated
tables, with clear statements of user and system requirements.
P2 Develop the database system with evidence of user interface, output and data validations, and querying across multiple
tables.
1. Introduction:
3. Design of the relational database system using appropriate design tools and techniques:
1|Page
P.1 Design a relational database system using appropriate design tools and techniques, containing at least four interrelated
tables, with clear statements of user and system requirements.
1. Introduction:
- Before going into my database introduction, I will say a few things that I know about the database.
A database is an organized collection of data, generally stored and accessed electronically from a computer system. Where
databases are more complex they are often developed using formal design and modeling techniques.
A flat-file database is a database stored in a file called a flat file. Records follow a uniform format, and there are no structures
for indexing or recognizing relationships between records. The file is simple. A flat file can be a plain text file, or a binary file.
Relationships can be inferred from the data in the database, but the database format itself does not make those relationships
explicit.
2|Page
1.2.2Hierarchical Databases
A hierarchical database model is a data model in which the data are organized into a tree-like structure. The data are stored as
records which are connected to one another through links. A record is a collection of fields, with each field containing only one
value. The type of a record defines which fields the record contains.
3|Page
1.2.3 Relational Databases
A relational database is a digital database based on the relational model of data, as proposed by E. F. Codd in 1970. A software
system used to maintain relational databases is a relational database management system (RDBMS). Many relational database
systems have an option of using the SQL (Structured Query Language) for querying and maintaining the database.
4|Page
Defined by repeating column(s) from one in another table
- Keys?
In RDBs, each table usually has one (or more) column(s) designated as a primary key
Giving one of its values, you can find exactly one row in the table
5|Page
To create relationship between the tables
6|Page
7|Page
1.2 Database Management System (DBMS)
The database management system (DBMS) is the software that interacts with end users, applications, and the database itself to
capture and analyze the data. The DBMS software additionally encompasses the core facilities provided to administer the
database. The sum total of the database, the DBMS and the associated applications can be referred to as a "database system".
Often the term "database" is also used to loosely refer to any of the DBMS, the database system or an application associated
with the database.
8|Page
There are many database management systems such as Oracle, MySQL, Microsoft SQL Server, PostgreSQL ... But in my opinion
MySQL is the most widely used management system, because Microsoft SQL Server is always a name present. in the list of the
most popular database management system rankings. Developed since 1989, using Assembly C language, Linux, C ++, this is a
commercial DBMS that many people love and choose to use by its utilities.
For convenience stores, cooffe shops, milk tea shops, or companies, the salary issue is still a big problem for them, they will
calculate the pay and will pay later than 5 to 7. day in that month, so I was thinking of a database system to help with this
- There will be quite a lot of employees in the store or company and including their name, age and hometown
- There will be quite a lot of branch stores or companies so the assignment of employees to where to work is by their
managers.
- Customer is god.
- For product will have product name, product code.
- Sales will be reported to the manager when the employee shifts to each other, including where they work.
- And finally, the salary, wages will be calculated according to sales and commissions of that employee
3. Design of the relational database system using appropriate design tools and techniques:
To manage employees, number of loyal customers, and salary, we designed a database called Salary System. The database
includes 6 new tables of relationships as follows:
Staff (Staff name nvarchar (30), Num at int, age int, home town nvarchar (MAX))
9|Page
Revenue (Work place nvarchar (50), Staff name nvarchar (30), Target int)
Assigned (Num at int, Work nvarchar (50), Work place nvarchar (50))
Customer (Staff name nvarchar (30), Customer nvarchar (30), Product ID int, Money bonus money)
Product (ID Product int, Product nvarchar (50))
Salary (Num at int, Target int, Salary money, Money bonus money)
So I explained to everyone the better understanding of my company's Salary System and this is my diagram
10 | P a g e
P2 Develop the database system with evidence of user interface, output and data validations, and querying across
multiple tables.
12 | P a g e
Assigned table
Customer table
Product table
13 | P a g e
Revenue table
Salary table
Staff table
14 | P a g e
1.3. Value for each table
15 | P a g e
Revenue table values
16 | P a g e
2. Check if the results work
Now I will call up a few tables with the command to see what its output looks like.
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.
17 | P a g e
P3 Implement a query language into the relational database system.
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.
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.
19 | P a g e
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?
20 | P a g e
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.
21 | P a g e
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.
22 | P a g e
use [SALARY SYSTEM]
23 | P a g e
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.
24 | P a g e
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.
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);
The database development process all depends on the values you add inside it, just like the values I added inside of a table.
27 | P a g e
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].
28 | P a g e
Referent
Dịch vụ hosting | Thuê máy chủ ảo VPS | Đăng ký tên miền giá rẻ. (2020). Cơ sở dữ liệu database là gì? có những loại database nào?. [online]
Available at: https://hostingviet.vn/co-so-du-lieu-database-la-gi [Accessed 7 Mar. 2020].
VietTuts. (2020). RDBMS là gì? - học sql cơ bản đến nâng cao - VietTuts. [online] Available at: https://viettuts.vn/sql/rdbms-la-gi [Accessed 3
Mar. 2020].
Vn.wacontre.com. (2020). Ưu điểm nổi bật được mọi người sử dụng cơ sở dữ liệu Oracle là gì? | Tạo app Wacontre. [online] Available at:
https://vn.wacontre.com/vi/uu-diem-noi-bat-duoc-moi-nguoi-su-dung-co-so-du-lieu-oracle-la-gi-2/?fbclid=IwAR0WWKqYwgp6UDKOIXjTHi-
4ABW7A0eX7VqBU16vnAKNWWqjrLK7VTTTR1Q [Accessed 3 Mar. 2020].
Thư viện khoa học. (2020). Database là gì? Các loại database phổ biến - Thư viện khoa học. [online] Available at:
https://thuvienkhoahoc.net/database-la-gi-cac-loai-database-pho-bien.html [Accessed 7 Mar. 2020].
29 | P a g e
Blog TINOGROUP JSC. (2020). Database là gì ? Vai trò và tầm quan trọng của database. [online] Available at:
https://blog.tinohost.com/database-la-gi/ [Accessed 7 Mar. 2020].
Techopedia.com. (2020). What is a Database Management System (DBMS)? - Definition from Techopedia. [online] Available at:
https://www.techopedia.com/definition/24361/database-management-systems-dbms [Accessed 7 Mar. 2020].
SearchDataManagement. (2020). What is a Relational Database? - Definition from WhatIs.com.. [online] Available at:
https://searchdatamanagement.techtarget.com/definition/relational-database [Accessed 7 Mar. 2020].
Techterms.com. (2020). Flat File Definition. [online] Available at: https://techterms.com/definition/flatfile [Accessed 7 Mar. 2020].
30 | P a g e