You are on page 1of 16

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 Le Hong Minh Student ID GCD 191253

Class GCD0808 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

P1 M1 D1

1
2
 
Summative Feedback: Resubmission Feedback:

Grade: Assessor Signature: Date:


Signature & Date:

3
Contents
I: INTRODUCT..................................................................................................................................................................................................................... 5
II: DATA BASE .................................................................................................................................................................................................................... 6
III: SRS (System Requirement Specification) ........................................................................................................................................................................ 6
IV: DATA RELATIOSHIP .................................................................................................................................................................................................... 8
V: PROBLEM SLOVING..................................................................................................................................................................................................... 11
VI: System Requirement Specification ................................................................................................................................................................................. 11
VII: HIGH LEVEL DESIGN (ERD).................................................................................................................................................................................... 13

4
I: INTRODUCT
1/ Scenario:

I'm is employed as a Database Developer for a large IT consultancy company. The company has been approached by FPT university which is expanding due
to the growth of the number of students. FPT is currently facing difficulties in dealing with managing the university. It decided to develop several academic
systems to manage the university easier including: Online Library system, Student Grading System, Attendance System, CMS System, Scheduling System,
Enrolment Systems, and so on, so I must work with FPT to find out about current requirements for each system

2/ Solution:

- Analyze the requirements and produce clear statements of user and system requirements.
- Design a relational database system using appropriate design tools and techniques.
- Develop a fully functional relational database system, based on an existing system design.
- Test the system against user and system requirements.
- Produce technical and user documentation.

Figure 1: solution.

5
II: DATA BASE
1/ Define:
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.

2/ Benefit:
Developing a database for your business can help you:

- Reduce the amount of time you spend managing data


- Analyse data in a variety of ways
- Promote a disciplined approach to data management
- Turn disparate information into a valuable resource
- Improve the quality and consistency of information

III: SRS (System Requirement Specification)

1/ Define:
A System Requirements Specification (SRS) (also known as a Software Requirements Specification) is a document or set of documentation that describes the
features and behavior of a system or software application. It includes a variety of elements (see below) that attempts to define the intended functionality
required by the customer to satisfy their different users.
In addition to specifying how the system should behave, the specification also defines at a high-level the main business processes that will be supported,
what simplifying assumptions have been made and what key performance parameters will need to be met by the system.

Main Elements:

6
Depending on the methodology employed (agile vs waterfall) the level of formality and detail in the SRS will vary, but in general an SRS should include a
description of the functional requirements, system requirements, technical requirements, constraints, assumptions and acceptance criteria. Each of these
is described in more detail below:

- Business Drivers
- Business Model
- Functional and System Requirements
- Business and System Use Cases
- Technical Requirements
- System Qualities
- Constraints and Assumptions
- Acceptance Criteria

7
Figure 2: SRS

IV: DATA RELATIOSHIP

Database relationship has a very concrete mathematical foundation in classical database literature. To make it simple, we keep aside its mathematical
counterpart and try to understand the same analogically.

8
Entities are the key players of any system - for example in a school, teachers, students, and classrooms are entities. In much the same way, in an
organization employees, managers, projects, and departments are entities.

There are 3 types of relationships in relational database design. They are:


- One-to-One
- One-to-Many (or Many-to-One)
- Many-to-Many

One-to-One

A row in table A can have only one matching row in table B, and vice versa.

Diagram of a one-to-one relationship:

Figure 3

This is not a common relationship type, as the data stored in table B could just have easily been stored in table A. However, there are some valid reasons for
using this relationship type. A one-to-one relationship can be used for security purposes, to divide a large table, and various other specific purposes.

One-to-Many (or Many-to-One)

This is the most common relationship type. In this type of relationship, a row in table A can have many matching rows in table B, but a row in table B
can have only one matching row in table A.

9
Figure 4

One-to-Many relationships can also be viewed as Many-to-One relationships, depending on which way you look at it.

Many-to-Many

In a many-to-many relationship, a row in table A can have many matching rows in table B, and vice versa.
A many-to-many relationship could be thought of as two one-to-many relationships, linked by an intermediary table.
The intermediary table is typically referred to as a “junction table” (also as a “cross-reference table”). This table is used to link the other two tables
together. It does this by having two fields that reference the primary key of each of the other two tables. The following is an example of a many-
to-many relationship:

Figure 5

So in order to create a many-to-many relationship between the Customers table and the Products table, we created a new table called Orders.

10
In the Orders table, we have a field called CustomerId and another called ProductId. The values that these fields contain should correspond with a value in
the corresponding field in the referenced table. So any given value in Orders.CustomerId should also exist in the Customer.CustomerId field. If this wasn’t
the case then we could have orders for customers that don’t actually exist. We could also have orders for products that don’t exist. Not good referential
integrity.
Most database systems allow you to specify whether the database should enforce referential integrity. So, when a user (or a process) attempts to insert
a foreign key value that doesn’t exist in the primary key field, an error will occur.

V: PROBLEM SLOVING

After a while discussing with FPT, I think the school had a big deal with the data management of students and students in the school. So I think I should
design a relational database system and develop a fully functional relational database system, based on an existing system design.
- The First, I create a new data memory name StudentClass.
- Then, I use file StudentClass to create important tables in the student management database.
- After that ,I create important columns when managing students:
+ StudentId
+StudentName
+ClassId
+ClassCode
+BirthDate
+SubjectId
+SubjectName
+SessionCount
+Grade
- The last, I create commands can add new students, delete students, edit info of students, and especially important add new table add
commands and delete table commands, add columns, and delete columns.

VI: System Requirement Specification


1/ General requirements:

- Allows access to data in relational database management systems.


- Allows to define the data in the database and manipulate that data.
- Allows embedding in other languages using SQL modules, libraries and pre-compilers.
11
- Allows to create views, stored procedures, functions in a database.
- SQL will help to efficiently manage and query information faster, and make maintenance and security easier.

2/ Technical system requirements


During the process of designing and building software I always use SQL because it is an easy-to-use software and very good complement to the job. So
what is SQL?

SQL (Structured Query Language) is a standardized programming language that's used to manage relational databases and perform various operations
on the data in them. Initially created in the 1970s, SQL is regularly used not only by database administrators, but also by developers writing data
integration scripts and data analysts looking to set up and run analytical queries.

The uses of SQL include modifying database table and index structures; adding, updating and deleting rows of data; and retrieving subsets of information
from within a database for transaction processing and analytics applications. Queries and other SQL operations take the form of commands written as
statements -- commonly used SQL statements include select, add, insert, update, delete, create, alter and truncate.

SQL became the de facto standard programming language for relational databases after they emerged in the late 1970s and early 1980s. Also known as
SQL databases, relational systems comprise a set of tables containing data in rows and columns. Each column in a table corresponds to a category of data --
for example, customer name or address -- while each row contains a data value for the intersecting column.

SQL standard and proprietary extensions


An official SQL standard was adopted by the American National Standards Institute (ANSI) in 1986 and then by the International Organization for
Standardization, known as ISO, in 1987. More than a half-dozen joint updates to the standard have been released by the two standards development
bodies since then; as of this writing, the most recent version is SQL:2011, approved that year.
Both proprietary and open source relational database management systems built around SQL are available for use by organizations. They include:

- Microsoft SQL Server


- Oracle Database
- IBM DB2
- SAP HANA
- SAP Adaptive Server
- MySQL (now owned by Oracle)
- PostgreSQL

12
However, many of these database products support SQL with proprietary extensions to the standard language for procedural programming and other
functions. For example, Microsoft offers a set of extensions called Transact-SQL (T-SQL), while Oracle's extended version of the standard is PL/SQL. As a
result, the different variants of SQL offered by vendors aren't fully compatible with one another.

SQL commands and syntax


SQL commands are divided into several different types, among them data manipulation language (DML) and data definition language (DDL) statements,
transaction controls and security measures. The DML vocabulary is used to retrieve and manipulate data, while DDL statements are for defining and
modifying database structures. The transaction controls help manage transaction processing, ensuring that transactions are either completed or rolled back
if errors or problems occur. The security statements are used to control database access as well as to create user roles and permissions.

VII: HIGH LEVEL DESIGN (ERD)

1/ Flowchart:

Figure 6

13
Attributes list:

Class Table:
- Class ID: Primary key, the ID numbers for the class
- ClassCode: Foreign key

Student Table:

- Student ID: Primary key, the ID numbers for the student


- StudentName: Name of student
- ClassId: Id of class
- Birthday: the birthday of a student

Subject table:
- SubjectID: Primary key, the ID numbers for the subject
- SubjectName: Foreign key of subject
- Sessioncount: the lesson of the student

Result Table:
- SubjectID, StudentId: Primary key, the unique ID numbers for the result
2/ Explanation:

Figure 7

- The student table vs the class table: Students may not be in any class or can study with many different classes. so it is a One-to-many
relationship.

Figure 8

- The subject table vs the grade table: Subject related one to one of the 'points'. This means that a subject can get only one point, not more. so it is a One-to-
one relationship

Figure 9

15
- The student table vs the subject table: The student relates one to zero or more to the Subject. This means that a student may not study any
subject or may study in many different subjects. so it is a One-to-many relationship

Figure 10

- The student table vs the grade table: Subject related to the “grade”.The student can get only one grade, not more.. so it is a One-to-many
relationship

You might also like