Uploaded by Diệp Quân❻❾

ASSIGINMENT Quan

advertisement
ASSIGNMENT 1 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
Pham Manh Quan
Student ID
BHAF190226
Class
BH-AF-2005-2.3
Assessor name
DINH THI MINH NGUYET
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
P1
M1
D1
1
Phạm Mạnh Quân
❒ Summative Feedback:
Grade:
Signature & Date:
❒ Resubmission Feedback:
Assessor Signature:
Date:
2
Contents
INTRODUCTION ................................................................................................................ 4
I. Literature review ................................................................................................................ 5
1. Database ........................................................................................................................ 5
2. There are different main types of databases .................................................................... 5
a. Flat File Databases ..................................................................................................... 5
b. Hierarchical Databases ............................................................................................... 5
c. Relational Databases .................................................................................................. 5
3. Relational Database Management System ...................................................................... 5
4. Stages of the database design ......................................................................................... 6
II. Statement of work............................................................................................................. 6
1. Hirstory ......................................................................................................................... 6
2. Aims .............................................................................................................................. 6
3. Scope ............................................................................................................................. 6
III. Requirement .................................................................................................................... 6
IV. Database Design.............................................................................................................. 7
1. Conceptual design and Logical design ........................................................................... 7
2. Relationship ................................................................................................................... 9
3. Normalization .............................................................................................................. 11
4. Physical Design ........................................................................................................... 11
5. Interface design ........................................................................................................... 14
CONCLUTION................................................................................................................... 16
REFERENCES ................................................................................................................... 17
3
INTRODUCTION
In this report, I will introduce: Literature review, Statement of work, Requirement, Database Design. Also
I will introduce how to design the Enrolment system.
4
I. Literature review
1. Database
- Definition: A database is an organized collection of structured information or data, usually
stored online in a computer system. A database is usually controlled by a database management
system (DBMS). The data and the DBMS, together with their associated applications, are
called a database system, often shortened to a database. [1]
2. There are different main types of databases
+ Flat File Databases
+ Hierarchical Databases
+ Relational Databases
a. Flat File Databases [2]
- A flat file database is a database that stores data in a plain text file. Each line of the text file
holds one record, with fields separated by delimiters, such as commas or tabs. While it uses a
simple structure, a flat file database cannot contain multiple tables like a relational database
can.
- Flat file is also a type of computer file system that stores all data in a single directory. There
are no folders or paths used organize the data. While this is a simple way to store files, a flat
file system becomes increasingly inefficient as more data is added. The original Macintosh
computer used this kind of file system, creatively called the Macintosh File System (MFS).
However, it was soon replaced by the more efficient Hierarchical File System (HFS) that was
based on a directory structure.
b. Hierarchical Databases
- Hierarchical databases are organized in a tree-like structure.
+ Parent table can have many child tables.
+ No child table can have more than one parent.
+ They are connected to one another through links or indexes.
+ Allows the one-to-one and a one-to-many relationship between two types of data.
c. Relational Databases [3]
- A relational database (RDBMS) is a collection of data items with pre-defined relationships
between them. These items are organized as a set of tables with columns and rows. Tables are
used to hold information about the objects to be represented in the database
- Each column in a table holds a certain kind of data and a field stores the actual value of an
attribute. The rows in the table represent a collection of related values of one object or entity.
Each row in a table could be marked with a unique identifier called a primary key, and rows
among multiple tables can be made related using foreign keys. This data can be accessed in
many different ways without reorganizing the database tables themselves.
3. Relational Database Management System (RDBMS)
-
RDBMS stands for Relational Database Management System which means relational database
management system. The RDBMS is the basis for SQL and for all modern database systems
such as MS SQL Server, IBM DB2, Oracle, MySQL, and Microsoft Access.
5
-
The Relational Database Management System (RDBMS) is a database management system
(DBMS) based on the relational model introduced by EF Codd.
4. Stages of the database design [4]
+Conceptual design
-
-
When every data requirement is stored and analyzed, the next thing that we need to do is
creating a conceptual database plan. Here, a highly leveled conceptual data model is used. This
phase is called the conceptual design. Stages of the database design
When the conceptual design phase is in progress, the basic data modeling operations can be
deployed to define the high-level user operations that are noted during the analysis of the
functions.
+ Logical Design
-
-
The logical phase of database design is also called the data modeling mapping phase. This
phase gives us a result of relation schemas. The basis for these schemas is the ER or the Class
Diagram.
To create the relation schemas is mainly mechanical operation. There are rules for transferring
the ER model or class diagram to relation schemas.
+ Physical Design
-
The last phase of database design is the physical design phase. In this phase, we implement the
database design. Here, a DBMS (Database Management System) must be chosen to use.
For instance, different DBM systems have different names for every datatype and they have
different data types.
SQL clauses are written to help in creating the database. Also, the indexes and the integrity
constraints (rules) are defined in this phase. And finally, the data is added and the database can
finally be tested.
II Statement of work
1. History
As far as I can see, FPT University is now recruiting more and more students. However, the school
still has a huge disadvantage that admission information is messed up, not optimized, making
enrollment more complicated and difficult.
2. Aims
To overcome this shortcoming, I have discussed with the school that will Design an Admission
System for the school. This allows users to enter the information of students enrolling quickly,
effectively, and in the most time-saving manner
3. Scope
I will create an Enrolment system so that the school admissions staff can enter the correct student
information into the school or can find information about students already enrolled in the school in
the best way.
III. System requirements
6
Enrolment system
-
-
-
-
Allows to store and retrieve student information. For each student, it is necessary to manage
the following information: SV code, Full name, gender, date of birth, place of birth, address,
ID number or citizen identification, class
Store and retrieve information about the school's subjects including subject code, subject name,
subject description, curriculum unit number, teacher's name, teacher number, teacher
recruitment date.
+ Each subject will be assigned a unique standard code by the primary school: F *** where F
is fixed. * is the number from 1 to 9.
+ Number of curriculum units are real numbers> 0 and <7.
+ Each subject can have 1-3 teachers participating in teaching
Each time a student registers a subject, he / she will save the following information: name,
class of registered student, subject code, subject name, semester, school year. Inside:
+ School year in the format eg 2019-2020
+ Each year there are only 2 semesters: HK1 and HK2
+ A course must not exceed 100 students, each student cannot register more than 5 subjects /
semester
+ Do not register for a course twice in the same semester
Each student has 1 account to log into the system, after successfully logging in, students can
register or view the subjects they have registered.
IV. Database design
1. Conceptual design and Logical design
a. Identify all entities
In the above problem, I found 4 entities
- Student
- Course
- Teacher
- Subject
b. Attributes
In this database, I have attributes for each entity:
- Student entities have 8 attributes
7
-
Course entities have 4 attributes
-
Teacher entities have 3 attributes
-
Subject entities have 5 attributes
8
2. Relationship
-
Relationship between Course and Subject
-
Relationship between Subject and Teacher
9
-
Relationship between Student and Subject
10
-
However, here, the relationship between the student and the subject is much more. So I used
linking entity StudentSubject.
In conclusion, the ERD for this system is
3. Normalization
-
-
-
For the above schematic of mine drawn, the normalized form 1NF is reached
+ It should only have single(atomic) valued attributes/columns.
+ Values stored in a column should be of the same domain
+ All the columns in a table should have unique names.
+ And the order in which data is stored, does not matter.
Next, to achieve the 2NF normalized form, we must achieve the 1NF normalized form. My
post has achieved the standardized 2NF format
+ Identify primary key for the 1NF relation
+ Identify functional dependencies in the relation
+ If partial dependencies exist on the primary key
+ Remove them by placing them in a new relation.
+ Leave a copy of their determinant in the original relation to keep the relationship.
Finally to achieve the normal 3NF form we have to reach 1NF and 2NF and my post has
reached the 3NF normal form
+ In 2NF and in which no non-primary-key attribute is transitively dependent on the primary
key
+ All non-prime attributes are fully & directly dependent on the PK.
4. Physical Design
Following is the code in SQL to display entities and properties in ERD.
11
-
Table Student
-
In the Student entity, there are properties that have different types of databases as follows:
+ ID: int-primary key
+ Name: nvarchar
+ Dob: varchar
+ Sex: varchar ...
Table Course
-
Table Teacher
12
-
Table Subject
-
Linking entity table
13
-
And this is the result
5. Interface design
In order to be able to enter all the admission information, I will design the interface for the Enrolment
system. Since there are 4 entities, I will show everyone an example of a Student interface.
14
-
And this is the result
15
CONCLUTION
To summarize, I gave an overview of the basics of databases and detailed instructions on how to design an
Enrolment system.
16
REFERENCES
[1] 2020. [online] Available at: <https://thuvienkhoahoc.net/database-la-gi-cac-loai-database-phobien.html> [Accessed 19 September 2020].
[2]https://techterms.com/definition/flatfile#:~:text=A%20flat%20file%20database%20is,like%20a%20rel
ational%20database%20can
[3]https://aws.amazon.com/vi/relationaldatabase/#:~:text=A%20relational%20database%20is%20a,be%20
represented%20in%20the%20database
[4] https://medium.com/@deeplogica/the-4-phases-that-create-database-design-31571111e683
17
Download