Prashath DDD Assignment

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 40

DATABASE DESIGN

DEVELOPMENT

N[Type
prashath
here] J/IT/20/17/14 6/15/21
[Type here] DDD here]
[Type
DATABASE DESIGN DEVELOPMENT

Acknowledgement

The success and final outcome of this assignment required a lot of guidance and assistance from
many people and me extremely fortunate to have got this all along with the completion of my
assignment work. Whatever I have done is only due to such guidance and assistance and I would
not forget to thank them. I respect and thank my lecturer Ms.A.Aarathy for giving me an opportunity
to do this assignment work and providing us all support and guidance which made me complete
the assignment on time, we extremely grateful to him for providing such nice support and
guidance.

We are really grateful because we managed to complete this assignment within the time given
by my lecturer. This assignment cannot be completed by me without the effort and help from my
friends. Last but not least, I would like to express my gratitude to my family members and
respondents for their support and willingness to spend some time with me.

NITHIYAKUMAR PRASHATH
BTEC HND in CSD Department
J/IT/20/17/14
CSD 17

N PRASHATH J/IT/20/17/14 1
DATABASE DESIGN DEVELOPMENT

Introduction

Database system continue to demand more complex data structures and interfaces, as
applications get increasingly sophisticated. Database design and development is a
fundamental and highly beneficial skill for computing student to master, regardless of their
specialism. On successful completion of this unit students will be able to use appropriate
tools to design and develop a relational database system for a substantial problem

LO 1 - Use an appropriate design tool to design a relational database system for a


substantial problem

LO 2 - Develop a fully functional relational database system, based on an existing system


design.

LO 3 – Test the system against user and system requirements

LO 4 – Produce technical and user documentation

N PRASHATH J/IT/20/17/14 2
DATABASE DESIGN DEVELOPMENT

Contents
Acknowledgement............................................................................................................................... 1
Introduction ......................................................................................................................................... 2
Table of Figures .................................................................................................................................. 6
Task 01 Use an appropriate tool to design a relational database system for a substantial problem
........................................................................................................................................................... 7
Poster Presentation ..................................................................................................................... 7
EER diagram ................................................................................................................................... 7
Creation of XYZ Campus Accommodation EER Diagram ................................................................ 8
Create Data Base of the name “XYZCampusAccommodation” .................................................... 8
Create Tables .............................................................................................................................. 8
Create columns and Set Primary Key .......................................................................................... 9
Set Foreign Key ........................................................................................................................... 9
EER Diagram of XYZ Campus Accommodation ............................................................................ 10
ER Diagram ............................................................................................................................... 11
ER Diagram Symbols .................................................................................................................... 11
Steps to Draw ER Diagrams.......................................................................................................... 12
Benefits of ER diagrams ................................................................................................................ 12
Mock-up ........................................................................................................................................ 12
Sample mockups of XYZ Campus Accommodation Database System .......................................... 13
Normalization ................................................................................................................................ 17
1NF (First Normal Form) Rules .................................................................................................. 17
2NF (Second Normal Form) Rules ............................................................................................. 17
3NF (Third Normal Form) Rules ................................................................................................. 18
Evaluation of the proposed database system ................................................................................ 18
Task 02 Develop a fully functional relational database system, based on an existing system design 20
Build the physical relational Database system ............................................................................... 20
Create Data Base.......................................................................................................................... 20
Create Tables................................................................................................................................ 20
Create student table ................................................................................................................... 21
Create leases table .................................................................................................................... 21
Create invoices table ................................................................................................................. 22
Sample Records into the Tables ................................................................................................... 23
Sample records of courses table ................................................................................................ 23

N PRASHATH J/IT/20/17/14 3
DATABASE DESIGN DEVELOPMENT

Sample records of parents’ table................................................................................................ 23


Privilege Matrix.............................................................................................................................. 24
Control privilege ......................................................................................................................... 25
Individual privileges .................................................................................................................... 25
Implement complex queries........................................................................................................... 25
DELETE ..................................................................................................................................... 26
UPDATE .................................................................................................................................... 27
INSERT ..................................................................................................................................... 27
ALTER ....................................................................................................................................... 28
Task 03 Test the system against user and system requirements ...................................................... 29
Data Verification and Validation .................................................................................................... 29
Verification ................................................................................................................................. 29
Validation ................................................................................................................................... 30
Testing .......................................................................................................................................... 30
Structural database testing ........................................................................................................ 30
Schema testing .......................................................................................................................... 30
Database table, column testing .................................................................................................. 30
Stored procedures testing .......................................................................................................... 31
Functional database testing ....................................................................................................... 31
Non-functional testing ................................................................................................................ 31
Error Report .................................................................................................................................. 32
Effectiveness of database solution and improvements in user and system requirements .............. 33
Task 04 Produce technical and user documentation ......................................................................... 34
Technical Manual ....................................................................................................................... 34
System configuration ................................................................................................................. 34
Hardware requirements.............................................................................................................. 34
Software requirements ............................................................................................................... 34
The design database system and future improvements ............................................................. 36
Campus Accommodation Flow Chart ............................................................................................ 37
Conclusion ........................................................................................................................................ 38
References ....................................................................................................................................... 39

N PRASHATH J/IT/20/17/14 4
DATABASE DESIGN DEVELOPMENT

N PRASHATH J/IT/20/17/14 5
DATABASE DESIGN DEVELOPMENT

Table of Figures

Figure 1 Poster presentation ............................................................................................................... 7


Figure 2 create database .................................................................................................................... 8
Figure 3 Create table .......................................................................................................................... 8
Figure 4 Create column and primary key............................................................................................. 9
Figure 5 Set a foreign key ................................................................................................................... 9
Figure 6 ER diagram ......................................................................................................................... 10
Figure 7 relationship ......................................................................................................................... 11
Figure 8 er diagram symbol............................................................................................................... 11
Figure 9 mock-up-1 ........................................................................................................................... 13
Figure 10 mock-up-2 ......................................................................................................................... 14
Figure 11 mock-up-3 ......................................................................................................................... 14
Figure 12 mock-up-4 ......................................................................................................................... 15
Figure 13 mock-up-5 ......................................................................................................................... 16
Figure 14 first normal form ................................................................................................................ 17
Figure 15 second form ...................................................................................................................... 17
Figure 16 3rd normal form ................................................................................................................. 18
Figure 17 Create Database ............................................................................................................... 20
Figure 18 Create Student Table ........................................................................................................ 21
Figure 19 create leases table ............................................................................................................ 21
Figure 20 Create invoice table .......................................................................................................... 22
Figure 21Sample Records into the Table .......................................................................................... 23
Figure 22 Sample records of courses table ....................................................................................... 23
Figure 23Sample records of parents’ table ........................................................................................ 24
Figure 24 SELECT ............................................................................................................................ 25
Figure 25 DELETE ............................................................................................................................ 26
Figure 26 UPDATE ........................................................................................................................... 27
Figure 27 INSERT ............................................................................................................................. 27
Figure 28 ALTER .............................................................................................................................. 28
Figure 29 Error when creating Inspection table ................................................................................. 32
Figure 30 Error when creating student advisor table ......................................................................... 32
Figure 31 Error when creating hall table ............................................................................................ 32
Figure 32 Error when insert value into courses table ......................................................................... 33

N PRASHATH J/IT/20/17/14 6
DATABASE DESIGN DEVELOPMENT

Task 01 Use an appropriate tool to design a relational database


system for a substantial problem
Poster Presentation

Figure 1 Poster presentation

EER diagram

EER Model (Enhanced Entity Relationship Model) is a high-level data model that integrates the original
ER model's extensions. It is a diagrammatic technique for displaying:
• Sub Class and Super Class
• Specialization and Generalization
• Union or Category
• Aggregation

N PRASHATH J/IT/20/17/14 7
DATABASE DESIGN DEVELOPMENT

Creation of XYZ Campus Accommodation EER Diagram

Create Data Base of the name “XYZCampusAccommodation”

First, open MySQL Workbench; Go to the file option; Then click new model. After that rename the
Database name as “XYZCampusAccommodation”.

Figure 2 create database

Create Tables

Figure 3 Create table

Click the Add Table to create a new table. Then we can rename the table with meaningful title

N PRASHATH J/IT/20/17/14 8
DATABASE DESIGN DEVELOPMENT

Create columns and Set Primary Key

Figure 4 Create column and primary key

Have to create columns with meaning full name with suitable Datatype. To set a column as Primary
Key, put the tick mark in the box of PK.

Set Foreign Key

Figure 5 Set a foreign key

To set Foreign Keys, Click the Foreign Keys option which is on the bottom line. Then type the
Foreign Key name and select the Referenced table where that is as Primary Key and Select the
Referenced Column.

N PRASHATH J/IT/20/17/14 9
DATABASE DESIGN DEVELOPMENT

EER Diagram of XYZ Campus Accommodation

Figure 6 ER diagram

N PRASHATH J/IT/20/17/14 10
DATABASE DESIGN DEVELOPMENT

ER Diagram
An Entity Relationship Diagram (ERD) is a visual representation of the relationships between
various entities in a system. For example, the elements course, student, and invoices tables may
be described using ER diagrams the following way:

Figure 7 relationship

ER Diagram Symbols

Figure 8 er diagram symbol

N PRASHATH J/IT/20/17/14 11
DATABASE DESIGN DEVELOPMENT

An ER Diagram has three basic components: object, attribute, and relationship. There are additional
elements that are based on the main elements. Such as weak entity, multi valued attribute, derived
attribute, weak relationship, and recursive relationship. Other notations used in ER diagrams to further
describe relationships are cardinality and ordinarily

Steps to Draw ER Diagrams


 Identify all of the system's entities.
 In each diagram, an object should only appear once.
 Make rectangles for all entities and give them appropriate names.
 Determine the relationships between the entities.
 Add a diamond in the center to define the relationship and link them with a line.
 Entity attributes should be added.
 Offer each attribute a meaningful name so that it can be easily understood

Benefits of ER diagrams
For building and manipulating databases, ER diagrams are extremely useful. To begin with, ER
diagrams are simple to understand and do not necessitate thorough training in order to work with them
effectively and accurately.
This means that designers, regardless of their IT knowledge, can use ER diagrams to interact with
developers, clients, and end users. ER diagrams can easily be converted into relational tables, which
can be used to build databases quickly. Furthermore, database developers may use ER diagrams as
a model for integrating data in specific software applications.

Mock-up
Color schemes, layouts, typography, iconography, navigation graphics, and the overall atmosphere of
the product are all expressed in mockups, which are usually mid to high fidelity.
Mockups show how the final product will look, and interactive elements such as buttons and icons hint
at how it will function. Mockups, unlike prototypes, do not actually represent the functionality.

N PRASHATH J/IT/20/17/14 12
DATABASE DESIGN DEVELOPMENT

Sample mockups of XYZ Campus Accommodation Database System

Figure 9 mock-up-1

N PRASHATH J/IT/20/17/14 13
DATABASE DESIGN DEVELOPMENT

This is the welcome page of the XYZ Campus Accommodation Database System. In this page, mainly
there are two options. Such as add new student and view student.

Figure 10 mock-up-2

If Add new Student has selected at first page, this page will be displayed. This form has so many
details of student differentiated by headings. This is a home page which has basic details of a
student.

Figure 11 mock-up-3

N PRASHATH J/IT/20/17/14 14
DATABASE DESIGN DEVELOPMENT

This form includes the details of student’s residence. There are two types of residences available in
this campus. They are hall of residence and students flat

Figure 12 mock-up-4

This form includes the detail of contact us. In this website user’s problem, you can contact us or fill this
form and send us.

N PRASHATH J/IT/20/17/14 15
DATABASE DESIGN DEVELOPMENT

Figure 13 mock-up-5

This form includes booking info. single bed or Deluxe bed or room, you can Oder our website and stay
here safely and computable and arrival time and departure time also indicate for you.

N PRASHATH J/IT/20/17/14 16
DATABASE DESIGN DEVELOPMENT

Normalization
Normalization is a process of organizing the data in database to avoid data redundancy, insertion
anomaly, update anomaly and deletion anomaly.

1NF (First Normal Form) Rules


• Each table cell should contain a single value.
• Each record needs to be unique.

Figure 14 first normal form

2NF (Second Normal Form) Rules

• Rule 1- Be in 1NF • Rule 2- Single Column Primary Key


• It's obvious that we won't be able to move forward with creating our simple database in 2nd
Normalization form unless we partition the table above.
• No non-prime attribute is reliant on the correct subset of any table's candidate keys. The term
"non-prime attribute" refers to an attribute that is not part of any candidate key.

Figure 15 second form

N PRASHATH J/IT/20/17/14 17
DATABASE DESIGN DEVELOPMENT

3NF (Third Normal Form) Rules


• Rule 1- Be in 2NF
• Rule 2- Has no transitive functional dependencies

Figure 16 3rd normal form

Evaluation of the proposed database system

A database is a typically organized collection of structured data stored electronically in a computer


system. Data in the most common types of databases in use today is usually modeled in rows
and columns in a series of tables to make processing and data querying effective.

Here, we are making a computerized database model for campus accommodation. As a result,
we created the first logical diagrams to describe the data transfer procedure. We should make up
keen and logistic in these starting factors; only in this way will we be able to build a well-defined
database structure for this program.

By this scenario, we can divide the campus accommodation into parts and think of logical
requirements to make them computerized. As a result, if we test those specifications, we can
easily assess the entire system.

N PRASHATH J/IT/20/17/14 18
DATABASE DESIGN DEVELOPMENT

The user requirement I have used in this scenario:

• Students - Stores the student information


• Student advisor - Monitoring the student’s welfare and academic progression
• Hall of residence - Stores the details
• Hall - Provide the room count
• Student flats - Used to rent room to a student
• Leases - Used to outline the rights and responsibilities
• Invoices - Stores the payment data
• Inspection - Record each inspection information

The system requirements are:

Hardware Requirements – Processor (latest versions like i5, i7, i8)

RAM (4GB is ok, 8GB if you want)

Hard disk (Now 1TB is much enough)

Software Requirements - Operating System (latest Windows 10 is ok)

Database (is created by MySQL database)

N PRASHATH J/IT/20/17/14 19
DATABASE DESIGN DEVELOPMENT

Task 02 Develop a fully functional relational database system,


based on an existing system design
Build the physical relational Database system

Create Data Base


create database database
name;
To use that Database:

use database name;

Figure 17 Create Database

Create Tables
Creating the tables in MySQL Command line, can use the following code to create tables, set data
types, set Primary Key, set foreign Key, etc.

N PRASHATH J/IT/20/17/14 20
DATABASE DESIGN DEVELOPMENT

Create student table

Figure 18 Create Student Table

Create leases table

Figure 19 create leases table

N PRASHATH J/IT/20/17/14 21
DATABASE DESIGN DEVELOPMENT

Create invoices table

Figure 20 Create invoice table

N PRASHATH J/IT/20/17/14 22
DATABASE DESIGN DEVELOPMENT

Sample Records into the Tables

Figure 21Sample Records into the Table

Sample records of courses table

Figure 22 Sample records of courses table

Sample records of parents’ table

N PRASHATH J/IT/20/17/14 23
DATABASE DESIGN DEVELOPMENT

Figure 23Sample records of parents’ table

Privilege Matrix

A privilege is a type of authorization name permission, or permission to perform an action or


activity.

A MySQL account's rights determine which operations it is allowed to perform. MySQL privileges
vary depending on the context in which they are used and the degree of operation:

Administrative privileges - Users with administrative rights will handle the MySQL server's activity.
Since these privileges aren't tied to a single database, they're referred to as global privileges.

Database privileges - Database rights extend to the database as well as all of its objects. These
rights can be granted to individual databases or to all databases at the same time.

Privileges for database objects - Privileges for database objects like tables, indexes, views, and
stored routines can be granted for individual objects within a database, for all objects of a given
type within a database (for example, all tables in a database), or for all objects of a given type in
all databases.

N PRASHATH J/IT/20/17/14 24
DATABASE DESIGN DEVELOPMENT

Control privilege
You can access a database object if you have the Control privilege, and you can grant and revoke
privileges to or from other users on that object. Tables, views, nicknames, indexes, and packages
are the only objects that have the Control privilege.

Individual privileges
Individual rights may be assigned to a user to allow them to perform specific tasks on specific
items. Users with the administrative authority Access control or SECADM, or the Control right,
have the power to grant and remove privileges to and from other users.

Implement complex queries


SELECT

Figure 24 SELECT

N PRASHATH J/IT/20/17/14 25
DATABASE DESIGN DEVELOPMENT

DELETE

Figure 25 DELETE

N PRASHATH J/IT/20/17/14 26
DATABASE DESIGN DEVELOPMENT

UPDATE

Figure 26 UPDATE

INSERT

Figure 27 INSERT

N PRASHATH J/IT/20/17/14 27
DATABASE DESIGN DEVELOPMENT

ALTER

Figure 28 ALTER

N PRASHATH J/IT/20/17/14 28
DATABASE DESIGN DEVELOPMENT

Task 03 Test the system against user and system requirements

Data Verification and Validation


Data verification and validation are the main goals of workbench concept, but it's important to
understand the difference between the two in order to clearly outline all the basic elements of
each process:

Testi Expect Actual Success Evidence


ng ed results or Fail
way results
1 Primary Comman Success
key d
(repeat Success
data) fully
worked
2 Data Comman Success
type(int) d
success

3 Data type Comman Fail


(date) d fail

4 ENUM Comman Success


Data d worked
Type and
successf
ully

Verification
• Examines the software, the documentation, and the design.
• Reviews, desk-checking, walkthroughs, and inspection procedures are all examples of
inspection methods.
• Check for conformity with the specifications.
• Bug identification is carried out during the early development period.

N PRASHATH J/IT/20/17/14 29
DATABASE DESIGN DEVELOPMENT

• It precedes the verification.

Validation
• It's a method of evaluating and validating a particular product.
• It employs non-functional testing, as well as Black Box and White Box testing.
• Checks if the program meets the needs of the customers.
• It has the ability to find bugs that verification misses.
• When the verification is finished, it is carried out.

Testing

In this database I have used three types of testing. Such as:

1. Structural Testing
2. Functional Testing
3. Non-functional Testing
Structural database testing
The validation of all those elements within the data repository that are used exclusively for data
storage and are not allowed to be directly manipulated by end users is part of structural data
testing. In these types of studies, database server validation is also a crucial factor to remember.
The testers must master SQL queries in order to complete this process successfully.

Schema testing
Schema verification is mainly concerned with ensuring that the front end and back-end schema
mappings are comparable. As a consequence, schema testing is often referred to as mapping
testing.

Database table, column testing


Let's take a look at some database and column checking

• If the database field and column mappings in the back end are consistent with the frontend
mappings.

N PRASHATH J/IT/20/17/14 30
DATABASE DESIGN DEVELOPMENT

• Validation of the database fields and columns for length and naming convention as defined
by the specifications.
• Validation of any database tables/columns that aren't used or aren't mapped.
• Validation of the compatibility of the data type and field lengths compare the columns in
the backend database to those in the application's front end.
• Whether the database fields enable the user to provide the desired user inputs as defined
in the business requirement specification documents.

Stored procedures testing

• Whether the development team applied the necessary input data to the application under
test and covered all of the conditions/loops.
• Whether the development team used the TRIM operations correctly while data was
fetched from the database's appropriate tables.
• If the end user gets the desired result when the Stored Procedure is executed manually.
Functional database testing
Functional database testing, as defined by the requirement specification, must ensure that the
majority of the transactions and operations conducted by end users are in accordance with the
requirements.

Non-functional testing
In the context of database testing, non-functional testing can be classified into many groups
depending on the business requirements. Load testing, Stress testing, Protection testing, Usability
testing, and Compatibility testing are examples of these types of tests. When it comes to the task
of non-functional testing, load testing and stress testing, which can be grouped under the umbrella
of Performance Testing, serve two distinct purposes.

N PRASHATH J/IT/20/17/14 31
DATABASE DESIGN DEVELOPMENT

Error Report
Error when creating Inspection table

Figure 29 Error when creating Inspection table

Error when creating student advisor table

Figure 30 Error when creating student advisor table

Error when creating hall table

Figure 31 Error when creating hall table

Error when insert value into courses table

N PRASHATH J/IT/20/17/14 32
DATABASE DESIGN DEVELOPMENT

Figure 32 Error when insert value into courses table

Effectiveness of database solution and improvements in user and system


requirements

Data efficiency is the process of making data easier to use, manage, and access. While data
efficiency is characterized as the organization of data to make it easier to find and retrieve, it also
necessitates a substantial hardware component. Size, accuracy, security, redundancy,
importance, and overwriting are the effectiveness of Database.

Thousands of businesses depend on accurate data collection, updating, and monitoring on a


minute-by-minute basis. Employees use this information to create accounting reports, revenue
forecasts, and invoice customers. Staff have access to this information through a computerized
database. The use of a relational database is a tried and tested method of handling the
relationships between the different database components.

As a consequence, a good database design divides the information into subject-based tables to
eliminate redundant data. Access is given the details it needs to join the data in the tables together
as required. Assists in preserving and ensuring the accuracy and integrity of your results.

N PRASHATH J/IT/20/17/14 33
DATABASE DESIGN DEVELOPMENT

Task 04 Produce technical and user documentation

Technical Manual
System configuration
You may install the MySQL database system on a single server or multiple servers. If you need
to manage a large database system, you'll need a suitable server to install the system's
components. Such as web server, computing components, database, web service, documents
archive, etc.

Hardware requirements
A physical or virtual service with the following characteristics is required for database installation.

 Recent generation processor (i5 9th gen or above)


 RAM should be at least 4 GB or 8 GB for instances of many users
 Disk capacity should be minimum 500 GB to 1TB; this should be much higher if you need
to handle large archives of documents.

Also concentrate that:

 The disk capacity should be configured in RAID.


 The MySQL server data should be backed up on a regular basis.
 An UPS should be used to prevent power outages.

Software requirements
1. Operating system

You can use any operating system supporting the software (Windows operating system is
best because MySQL is more extensively tested on it).

2. Database

N PRASHATH J/IT/20/17/14 34
DATABASE DESIGN DEVELOPMENT

MySQL, Oracle databases now mostly used in the world. At this time, we created this
database system using MySQL so I recommended MySQL database is best.

N PRASHATH J/IT/20/17/14 35
DATABASE DESIGN DEVELOPMENT

The design database system and future improvements


A database management system (DBMS) is basically a computerized data storage system. We
must consider some things when creating a Database. Such as:
• Visualization & Reporting
• Security
• Functionality
• Support & Development
• Integration
• Scalability
• Cost and Suitability
Although, we can’t consider these all thinks appropriately when creating the Database. So, we
must consider these things when improvement the system.
The design of Database has to consider and improve. The six principles listed below are just a
few suggestions for improving a database design.
• Evaluate Primary Key Assignments.
• Evaluate Naming Conventions.
• Refine Attribute Atomicity.
• Identify New Attributes.
• Identify New Relationships.
• Refine Primary Keys as Required for Data Granularity.
Another thing is usability. That means consider how user-friendly the system will be for all those
members of staff required to use it. We also can improvement the system through getting
feedback from users.
DATABASE DESIGN DEVELOPMENT

Campus Accommodation Flow Chart


DATABASE DESIGN DEVELOPMENT

Conclusion
The process of obtaining real-world specifications, evaluating requirements, designing the data
and functions of the system, and then implementing the operations in the system is known as
database application creation. There are some types of databases. Such as:

• Centralized Database
• Distributed Database
• Relational Database
• NoSQL Database
• Cloud Database
• Object-oriented Databases

Database initial analysis, database design, installation and loading, testing and evaluation,
operation, and maintenance and evolution are the six phases of the Database Life Cycle (DBLC).

Since there is no data replication in a database, data consistency is guaranteed. All data is
consistent in the database, and all users accessing the database see the same information.
Furthermore, any database updates are automatically mirrored to all users, ensuring that there is
no data inconsistency.

We can get so many advantages from effective Database System. They are:

 Update errors were reduced, and accuracy was improved.


 Data confidentiality and freedom from application programs are improved.
 Users' data connectivity has been improved thanks to the use of host and query
languages.
 Data protection has been strengthened
DATABASE DESIGN DEVELOPMENT

References

Guru99.com. 2020. What Is Functional Testing? Types & Examples (Complete Tutorial). [online]
Available at: <https://www.guru99.com/functional-testing.html> [Accessed 12 June 2020].

Tutorial Cup. 2020. System Testing - Advantages of System Testing. [online] Available at:
<https://www.tutorialcup.com/testing/types-of-testing/system-testing.htm> [Accessed 12 June
2020].

https://www.mysql.com/

https://beginnersbook.com/2015/04/e-r-model-in-dbms/

https://www.tutorialspoint.com/

You might also like