Вы находитесь на странице: 1из 18

DATABASE

MANAGEMENET SYSTEM
UNIT: 38
Submitted by: Wasil Asif
Submitted to: Sir Faisal Saghir

I am appointed as a junior web developer in pizza hut head office Islamabad. My manager assigned me a
task to create and manage database of pizza shop to keep records efficiently. The pizza shop sells pizzas
to customers who walks in (takeaway) and also takes phone orders which may be delivered to the
customer's address.
Table of Contents
Types of Database Management Systems....................................................................................... 5
Hierarchical Databases................................................................................................................ 5
Network Databases ..................................................................................................................... 5
Relational Databases ................................................................................................................... 5
Object Oriented Model ............................................................................................................... 5
ER Model Database .................................................................................................................... 6
Different Modeling Languages of Database Management System ................................................ 6
Query Language .......................................................................................................................... 6
Data Definition Language (DDL) ............................................................................................... 6
Make ....................................................................................................................................... 6
DROP ...................................................................................................................................... 6
Remark .................................................................................................................................... 6
Modify..................................................................................................................................... 6
RENAME................................................................................................................................ 6
Data Manipulation Language (DML) ......................................................................................... 7
Addition .................................................................................................................................. 7
SELECT .................................................................................................................................. 7
UPDATE ................................................................................................................................. 7
Erase ........................................................................................................................................ 7
Data Control Language (DCL) ................................................................................................... 7
Transaction Control Language (TCL) ........................................................................................ 7
Relational data Structures and Constraints ..................................................................................... 7
Tables .......................................................................................................................................... 7
Tuple ........................................................................................................................................... 8
Relation Schema ......................................................................................................................... 8
Degree ......................................................................................................................................... 8
Cardinality................................................................................................................................... 8
Segment....................................................................................................................................... 8
Connection occurrence................................................................................................................ 8
Relation key ................................................................................................................................ 8
Attribute domain ......................................................................................................................... 8
Analyzing User and System Requirements..................................................................................... 8
Test Plan.......................................................................................................................................... 9
Step 1 .......................................................................................................................................... 9
Step 2 .......................................................................................................................................... 9
Step 3 .......................................................................................................................................... 9
Step 4 .......................................................................................................................................... 9
Step 5 .......................................................................................................................................... 9
Step 6 .......................................................................................................................................... 9
Step 7 .......................................................................................................................................... 9
Effectiveness of the Database System (Evaluation) ..................................................................... 10
Database ........................................................................................................................................ 11
delivery_staff ............................................................................................................................ 11
order_take_away ....................................................................................................................... 12
order_walk_in ........................................................................................................................... 12
shop_staff .................................................................................................................................. 13
Different Types of Testing to Analyze ......................................................................................... 13
Data Integrity Testing ............................................................................................................... 13
C ................................................................................................................................................ 13
R ................................................................................................................................................ 14
U................................................................................................................................................ 14
D................................................................................................................................................ 14
Atomicity testing ....................................................................................................................... 14
Consistency testing ................................................................................................................... 14
Disconnection testing ................................................................................................................ 14
Sturdiness testing ...................................................................................................................... 14
Different Ways to Optimize Database Solution............................................................................ 15
Optimizing Queries ................................................................................................................... 15
Optimizing indexes ................................................................................................................... 15
Optimizing CPU........................................................................................................................ 15
Data Defragmentation ............................................................................................................... 15
Disk Types ................................................................................................................................ 16
Coding Loops ............................................................................................................................ 16
Evaluating Database Administrative Tasks & Tools .................................................................... 16
Database backup and recovery.................................................................................................. 16
Security ..................................................................................................................................... 16
Authentication ........................................................................................................................... 16
Performance Monitoring ........................................................................................................... 16
Auditing .................................................................................................................................... 17
Tools Available for Managing Security and Authorization .......................................................... 17
Types of Database Management Systems
There are several types of database management systems. Given below are the 5 most common
types of DBMS.

1. Hierarchical databases
2. Network databases
3. Relational databases
4. Object-oriented databases
5. ER model databases

Hierarchical Databases
In a various Hierarchical database, or (progressive DBMSs) model, information is put away in a
parent-kids relationship hubs. In a various hierarchical database, other than real information,
records likewise contain data about their gatherings of parent/child connections.
In a various Hierarchical database model, information is sorted out into a tree like structure. The
information is put away in type of accumulation of fields where each field contains just one
Value.

Network Databases
Network Databases or (Network DBMSs) utilize a system structure to make connection between
elements. Network databases are predominantly utilized on a huge computerized PC. Network
databases are various leveled databases yet dissimilar to progressive databases where one hub
can have one parent in particular, a system hub can have association with different substances.

A system database looks increasingly like a web or interconnected system of records.

Relational Databases
In social relational databases or (RDBMS), the connection between information is social and
information is put away in tabular type of sections and lines. Every section in a table speaks to a
characteristic and each line in a table speaks to a record. Each field in a table represents a data
value. Structured Query Language (SQL) is the language used to inquiry a RDBMS including
embeddings, refreshing, erasing, and looking through records.

Object Oriented Model


This Model talks about the usefulness of the object oriented Programming. It takes more than
capacity of programming language objects. Object DBMS's expansion the semantics of the C++
and Java. It gives full-highlighted database programming ability, while containing local language
similarity. It adds the database usefulness to protest programming dialects. This methodology is
the analogical of the application and database improvement into a consistent information model
and language condition. Applications require less code, utilize increasingly common information
displaying, and code bases are simpler to keep up. Object oriented designers can compose total
database applications with a better than average measure of extra exertion.

ER Model Database
An ER model is ordinarily executed as a database. In a straightforward relational database usage,
each line of a table speaks to one case of a substance type, and each field in a table speaks to a
property type. In a social database a connection between elements is executed by putting away
the essential key of one element as a pointer or "remote key" in the table of another substance.

Different Modeling Languages of Database Management System


Query Language
Structure Query Language (SQL) is a database inquiry language utilized for putting away and
overseeing information in Relational DBMS.

Data Definition Language (DDL)


According to (SINGH, n.a) Data Definition Language (DDL) proclamations are utilized to
arrange the database structure or construction. It is a sort of language that enables the DBA or
client to portray and name those substances, characteristics, and connections that are required for
the application alongside any related uprightness and security limitations. Here are the
arrangements of undertakings that go under DDL:
Make - used to make questions in the database
DROP - used to erase objects from the database
Remark - used to add remarks to the information word reference
Modify - used to adjusts the structure of the database
RENAME - used to rename an article
Data Manipulation Language (DML)

According to (W3schools, n.a) Data Manipulation Language (DML) explanations are utilized to
oversee information inside composition objects. Here are the arrangements of undertakings that
go under DML:

Addition - It embeds information into a table

SELECT - It recovers information from a database

UPDATE - It updates existing information inside a table

Erase - It erases all records from a table, the space for the records remain

Data Control Language (DCL)


This language is basically used for the purpose of allowing and restricting users access to a
database.

Transaction Control Language (TCL)


The adjustments in the database that we made utilizing DML directions are completed or roll
backed utilizing TCL.

To persevere the progressions made by DML directions in database – COMMIT

To roll back the progressions made to the database – ROLLBACK

Relational data Structures and Constraints


According to (GeeksforGeeks, 2019) Characteristic: Each segment in a Table. Qualities are the
properties which characterize a connection. e.g., Student_Rollno, Name,etc.

Tables – In the Relational model the, relations are spared in the table arrangement. It is put away
alongside its substances. A table has two properties lines and segments. Lines speak to records
and sections speak to traits.
Tuple – It is only a solitary line of a table, which contains a solitary record.

Relation Schema: This shows the name of the relation with its attribute

Degree: The all-out number of characteristics which in the connection is known as the degree of
the relation.

Cardinality: Total number of columns present in the Table.

Segment: The section speaks to the arrangement of qualities for a particular characteristic.

Connection occurrence – Relation example is a limited arrangement of tuples in the RDBMS


framework. Connection occasions never have copy tuples.

Relation key - Every line has one, two or different traits, which is called connection key.

Attribute domain – Every trait has some pre-characterized worth and extension which is known
as characteristic area

Analyzing User and System Requirements


The owner requested that a database system be made for pizza shop where the pizza shop offers
pizzas to clients who strolls in (takeaway) and furthermore takes telephone orders which might
be conveyed to the client's location. At the point when a client arranges by telephone the
associate taking the request asks the accompanying from the client:

1. Name of the client

2. Phone number of the client.

3. Request number of the client request.

4. Conveyance address of the client.

5. Pizza size (Small, Medium-large and extra-large).

6. Pizza Flavor (BBQ, Fajita, Tikka, Vegetable, Seekh kabab, Supreme)

7. Discounted cost
After the request has been taken the associate dials the number given and affirms the request
with the client. It is necessitated that each request given by a client be recorded. The
representatives at the shop might be partitioned into two kinds: the individuals who work in the
shop and the individuals who complete the conveyances (the drivers). The driver will do the
request and convey to the client.

Keeping these conditions in mind a database system for the Pizza shop will be made in which
system or DBMS used will be MySQL which will make it easier to link with a frontend and
establish a connection, aside from that the interface of MySQL is very easy which will help in
better management of the database.

Test Plan
Step 1: Conduct a structural test of the Database which will include all of the elements situated
in the data repository which are primarily used for storage of data. This also includes the
validation of the database Servers. To perform this, mastery in SQL queries is required.

Step 2: Conducting a test of the Schema which involves mapping the front end and back end of
the schema are the same. This step also includes mapping the schemas for identifying the validity
of the views and the columns. A tool referred to as DBUnit can be used for schema testing and is
very useful for mapping testing

Step 3: Conducting a test of the Database columns which includes the validation of the length
and the naming conventions of the database columns as specified by the requirements. This also
includes the testing of the data types and field lengths. Key and index testing is also performed in
this step to validate the primary and foreign keys along with clustered indexes and non-clustered
indexes.

Step 4: Conducting a Trigger test to see whether coding conventions have been followed or not
and to see whether the triggers update the data in the correct way and format after the triggers
have been executed.

Step 5:Conducting a Functional Database test to see that whether a field is allowing NULL
values or not aside from that also checking to see if the size required for each field is sufficient
or not. Finally check if any computed fields are present in the database or not.

Step 6: Conducting and integrity test to see if the data is logically well organized or not and also
to check all the data and requirements of the database have been met according to the conditions
set forth before the project and also meeting the requirements according to the business.

Step 7: Finally conducting a security test to see whether the application is preventing the user
form logging into the system successfully. Finally, to check whether what privileges the user has
and doesn’t and making sure that the data stored in the database is secure from all ends so that no
loose ends are left unchecked.

The above given test has been drafted for this system which will ensure that no detail is left
unchecked and will be followed to the end without any mistakes to ensure continuity of the
system.

Effectiveness of the Database System (Evaluation)


According to (Lehr, 2018) As Far as the quality is concerned a full quality test was performed
that showed that all of the client requirements were met, and the client was satisfied with the end
result. The database consisted of all the required databases for each requirement made separately
for the better management of the system. Although many modifications could be made to the
database have been detailed to the client and upon client approval can be executed in the near
future. This states that all the quality and system requirement were met by the developer and
approved by the client leading to the satisfaction of the client with the overall project.
Database
Given below is the database that has been created for the client needs according to the client
requirements which take into account all of the work procedures of the pizza shop

delivery_staff
order_take_away

order_walk_in
shop_staff

Different Types of Testing to Analyze


According to (n.a, Database Testing Complete Guide (Why, What, And How To Test Data),
2019) Given below are the tests that will be used to test the database solution

Data Integrity Testing


For any of the CRUD activities, the refreshed and latest qualities/status of shared information
ought to show up on every one of the structures and screens. The worth ought not be refreshed
on one screen and show a more seasoned an incentive on another.

At the point when the application is under execution, the end client predominantly uses the
'CRUD' activities encouraged by the DB Tool.

C: Create – When client 'Save' any new exchange, 'create' activity is performed.
R: Retrieve – When client 'Search' or 'View' any spared exchange, 'Recover' activity is
performed.

U: Update – When client 'Alter' or 'Adjust' a current record, the 'Update' activity of DB is
performed.

D: Delete – When a client 'Delete' any record from the framework, 'Erase' activity of DB is
performed

Atomicity testing

will guarantee any exchange performed on this table is all or none for example no records are
refreshed if any progression of the exchange is failed.

Consistency testing
will guarantee that at whatever point the incentive in section A or B is refreshed, the whole
consistently stays 100. It won't permit inclusion/cancellation/update in A or B if the all-out
aggregate is something besides 100.

Disconnection testing
will guarantee that if two exchanges are occurring simultaneously and attempting to adjust the
information of the acid test table, at that point these tractions are executing in segregation.

Sturdiness testing
will guarantee that once an exchange over this table has been submitted, it will remain along
these lines, even in case of intensity misfortune, accidents, or blunders.

Here are some of the threats that are most common amongst database attacks so appropriate
security measures should be taken to prevent them from happening:

1. Weak Passwords
2. SQL Injection
3. User and Group Privileges
4. DBMS Failures enabled
5. Broken Configuration Management
6. Buffer Overflows
7. Privilege Escalation
8. Denial of Service
Different Ways to Optimize Database Solution
According to (Thumar, 2017 ) Each database requires exceptional approaches to be tuned,
according to its individual needs.

That is the reason, utilizing the best SQL database is prudent, as much as realizing various
approaches to optimize or boost the database, in order to guarantee the best performance out of
it. The extent of optimizing SQL Database for developers like say, Senior Java j2ee developers
vary from the work of a Database Administrator (DBA) in some regard and are indistinguishable
in different regards. In enormous organizations, developers and DBAs are frequently required to
work together, where, it has been seen that more regularly than not, a contention emerges
between the two groups. There are different ways by which SQL databases can be tuned.

Optimizing Queries
you can likewise accelerate SQL queries utilizing inquiry streamlining agents, for example,
EverSQL Query Optimizer, which will both accelerate the query and clarify the suggestions, so
you could learn for what's to come.

Optimizing indexes
Indexing, when done appropriately, can advance your Query execution span and increment by
and large database execution. Fundamentally, ordering rates up the information recovery
procedure and makes it increasingly proficient, in this manner sparing you (and your system)
time and exertion.

Optimizing CPU
The better your CPU, the quicker and progressively proficient your database will be. Hence, if
your database fails to meet expectations, you ought to consider moving up to a higher class CPU
unit; the more dominant your CPU is, the less strain it will be under when entrusted with
numerous applications and requirements.

Data Defragmentation
At the point when numerous records are kept in touch with the database and time passes by, the
records are fragmented in MySQL's inside information documents and on the disk itself. The
defragmentation of the plate will permit gathering the applicable information, so I/O related tasks
will run quicker, which will straightforwardly effect on by and large query and database
execution.
Disk Types
Working with SSD disks can altogether improve your general database execution, and explicitly
the SQL query execution.

Coding Loops
Abstaining from coding loops is especially required so as to abstain from backing off of the
entire arrangement. This can be accomplished by utilizing the one of a kind UPDATE or
INSERT directions with individual columns, and by guaranteeing that the order WHERE doesn't
refresh the stored information on the off chance that it finds similar already stored data.

Evaluating Database Administrative Tasks & Tools


Explained below are the database administrative tasks and tools

Database backup and recovery


Database administrators make reinforcement and recuperation plans and techniques dependent
on industry best practices, at that point ensure that the vital advances are pursued.
Reinforcements cost time and cash, so the database administrator may need to convince the
executives to play it safe to safeguard information.
System administrators or other work force may really make the reinforcements, yet it is the
database administrators’ duty to ensure that everything is done on timetable.On account of a
server disappointment or other type of information misfortune, the database administrator will
utilize existing reinforcements to reestablish lost data to the framework.

Security
A database administrator has to know the potential shortcomings of the database programming
and the organization's general framework and work to limit dangers. No framework is 100% safe
to assaults, however actualizing accepted procedures can limit dangers.
On account of a security rupture or abnormality, the database adminstrator can counsel review
logs to see who has done what to the information. Review trails are likewise significant when
working with controlled information.

Authentication
Setting up worker access is a significant part of database security. DBAs control who approaches
and what sort of access they are permitted. For example, a client may have consent to see just
certain snippets of data, or they might be denied the capacity to make changes to the system.

Performance Monitoring
Observing databases for execution issues is a piece of the on-going system upkeep a database
administrator performs. In the event that some piece of the system is hindering handling, the
database administrator may need to make arrangement changes to the product or include extra
equipment limit. Numerous sorts of checking apparatuses are accessible, and some portion of the
database administrator’s responsibility is to comprehend what they have to track to improve the
framework. Outsider associations can be perfect for re-appropriating this perspective, however,
ensure they offer current DBA support.

Auditing
Auditing is the checking and recording of chosen client database activities. It very well may be
founded on individual activities, for example, the sort of SQL articulation executed, or on mixes
of elements that can incorporate client name, application, time, etc.
The under given data reveals to us the sorts of auditing, what it includes, and the subsequent
review trails and records.
Examining is commonly used to:
1. Empower future responsibility for current moves made in a specific schema, table, or
row, or influencing explicit substance
2. Delete users (or others) from improper activities dependent on that responsibility
3. Research suspicious movement

Tools Available for Managing Security and Authorization


According to (n.a, Chapter 6 Security Plugins, n.a) these are some of the tools that can be used
1) MySQL includes several plugins that implement security features:
2) Plugins for verifying endeavors by customers to associate with MySQL Server.
3) A secret word approval module for executing secret word quality approaches and
surveying the quality of potential passwords.
4) Keyring modules that give secure stockpiling to touchy data.
5) MySQL Audit, actualized utilizing a server module, utilizes the open MySQL Audit API
to empower standard, approach based checking and logging of association and question
movement executed on explicit MySQL servers.
6) MySQL Firewall, an application-level firewall that empowers database heads to allow or
deny SQL articulation execution dependent on coordinating against whitelists of
acknowledged explanation designs.
Bibliography
DBMS Database Languages. (n.d.). Retrieved october 21, 2019, from W3Schools :
https://www.w3schools.in/dbms/database-languages/
Lehr, S. (2018, june 14). The Benefits Of Using Database Management Systems. Retrieved
october 11, 2019, from https://www.ringlead.com/: https://www.ringlead.com/blog/the-benefits-
of-using-database-management-systems/
n.a. (n.a, n.a n.a). Chapter 6 Security Plugins. Retrieved october 1, 2019, from dev.mysql:
https://dev.mysql.com/doc/mysql-security-excerpt/5.7/en/security-plugins.html
n.a. (2019, november 10). Database Testing Complete Guide (Why, What, And How To Test
Data). Retrieved november 11, 2019, from https://www.softwaretestinghelp.com/:
https://www.softwaretestinghelp.com/database-testing-process/
SINGH, C. (n.a, n.a n.a). DBMS languages. Retrieved october 21, 2019, from beginnersbook:
https://beginnersbook.com/2015/04/dbms-languages/
Thumar, C. (2017 , october n.a). 6 ways to optimize your SQL database. Retrieved october 15,
2019, from Jaxenter.com: https://jaxenter.com/6-ways-optimize-sql-database-136448.html
W3schools. (n.a, n.a n.a). DBMS Database Languages. Retrieved october 15, 2019, from
W3schools: https://www.w3schools.in/dbms/database-languages/#Data_Definition_Language
GeeksforGeeks. (2019). Relational Model in DBMS - GeeksforGeeks. [online] Available at:
https://www.geeksforgeeks.org/relational-model-in-dbms/ [Accessed 13 Oct. 2019].