Assignment - Database Design and Development

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

2022

Esoft – HND Batch


No : 78

N.M. Udesh Ishanka

[A DATABASE FOR THE


POLLY PIPE]

This is about databases and how to use it. Also if you read this you can have a
good knowledge about what database is and the importance of databases.
Contents
Activity 1 ........................................................................................................... 5
1.1What is database? .................................................................................. 5
1.2 Types of databases ............................................................................... 5
1.2.1 Relational databases .................................................................. 6
1.2.2 Object-oriented databases ......................................................... 6
1.2.3 Distributed databases ................................................................ 6
1.2.4 Data warehouses ....................................................................... 6
1.2.5 NoSQL databases ...................................................................... 6
1.2.6Graph databases ......................................................................... 6
1.2.7 OLTP databases ........................................................................ 7
1.2.8 Open source databases .............................................................. 7
1.2.9 Cloud databases ........................................................................ 7
1.2.10 Multi model database .............................................................. 7
1.2.11 Document/JSON database ...................................................... 7
1.2.12 Self-driving databases ............................................................. 7
1.3 Introduction .......................................................................................... 8
1.4 The user and system requirements of Polly pipe ................................. 8
1.4.1 Functional requirements............................................................ 9
1.4.2 Non – functional requirements ............................................... 9
1.4.3 System requirements ................................................................. 9
1.4.4 Hardware requirements and Software requirements ............... 10
1.5 About Polly pipe’s ER Diagram ........................................................ 10
1.5.1 Er diagram for Polly Pipe ....................................................... 11
1.5.2 This is the Logical Schema ................................................... 12
1.6 Data normalization ............................................................................. 12
1.6.1 Why Normalize Data?............................................................. 14
1.6.2First Ordinary Type (1NF) ....................................................... 14
1.6.3 The Second Standard Form (2NF) .......................................... 15
1.6.4 The Third Type of Normal (3NF) ........................................... 15
Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|
ID : Kan-00142214 Page 1
1.6.5 Fourth normal form ................................................................. 15
1.5.6 Provided logical schema normalization .......................................... 16
1.5.7 What is validation? ......................................................................... 16
1.5.7.1 Data validation ..................................................................... 17
Activity 2 ......................................................................................................... 19
2.1 This is about the Interface of Polly pipe ............................................ 19
2.1.1 Login form .............................................................................. 20
2.1.2 Main Form .............................................................................. 21
2.1.3 Employee details form ............................................................ 21
2.1.4 Customer details form ............................................................. 22
2.1.5 Installation details form .......................................................... 22
2.1.6 Equipment details form......................................................... 23
2.2 What is SQL? ..................................................................................... 23
2.3 What is DDL Statements? ............................................................... 24
2.3.1 DDL ........................................................................................ 24
2.3.2 DML........................................................................................ 26
2.4 Commands which used for Polly pipe database system: ................... 27
2.4.1 Select command ...................................................................... 27
2.4.2 Update Command ................................................................. 28
2.4.3 Delete Command .................................................................. 29
2.5 Polly pipe company system ............................................................... 30
2.5.1 Login form .............................................................................. 30
2.5.2 Employee details form .......................................................... 30
2.5.3 Customer details form........................................................... 31
2.5.4 Equipment details form......................................................... 32
2.5.5 Installation details form ........................................................ 32
2.5.6 Payment details ..................................................................... 33
2.6 Database security ............................................................................... 33
2.7 SQL statements .................................................................................. 34
2.7.1 ‘Select’ SQL Statement........................................................... 34
2.7.2 ‘Where’ statement ................................................................... 35

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 2
2.7.3 ‘Update’ statement ................................................................ 36
2.7.4 ‘Between’ statement ............................................................. 38
2.7.5 ‘In ’ Statement ...................................................................... 39
2.7.6 ‘Group by’ statement ............................................................ 40
2.7.7 ‘Order by’ statement ............................................................... 41
Activity 3 ......................................................................................................... 41
3.1 Test plan ............................................................................................. 42
3.2 Test procedure .................................................................................... 43
3.3 Database testing ................................................................................. 43
Activity 4 ......................................................................................................... 44
4.1 Produce technical and user documentation ........................................ 44
4.1.1 Technical and user documentation.......................................... 44
References ........................................................................................................ 46

Table of Figures
Figure 1 DBMS .............................................................................................. 5
Figure 2 4 Hardware requirements and Software requirements .................. 10
Figure 3 Er diagram for Polly Pipe .............................................................. 11
Figure 4 Logical Schema ........................................................................... 12
Figure 5 Insert Data ..................................................................................... 17
Figure 6 Update Data ................................................................................... 18
Figure 7 Delete Data .................................................................................... 19
Figure 8 Login Form .................................................................................... 20
Figure 9 Main form ...................................................................................... 21
Figure 10 Employee form ............................................................................ 21
Figure 11 Customer Details ......................................................................... 22
Figure 12 Installation details form ............................................................... 22
Figure 13 Equipment.................................................................................... 23
Figure 14 Payment form .............................................................................. 23

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 3
Figure 15 Select ........................................................................................... 27
Figure 16 ...................................................................................................... 27
Figure 17 Update.......................................................................................... 28
Figure 18 ...................................................................................................... 28
Figure 19 Delete ........................................................................................... 29
Figure 20 Login form ................................................................................... 30
Figure 21 Employee details form ................................................................. 30
Figure 22 Customer details form ................................................................. 31
Figure 23 Equipment details form ............................................................... 32
Figure 24 Installation details form ............................................................... 32
Figure 25 Payment details ............................................................................ 33
Figure 26 select ............................................................................................ 34
Figure 27 ...................................................................................................... 35
Figure 28 ‘Where’ statement ....................................................................... 35
Figure 29 ...................................................................................................... 36
Figure 30 ‘Update’ statement....................................................................... 36
Figure 31 ...................................................................................................... 37
Figure 32 ‘Between’ statement .................................................................... 38
Figure 33 ‘In ’ Statement ............................................................................. 39
Figure 34 Group statement........................................................................... 40
Figure 35 ‘Order by’ statement .................................................................... 41
Figure 36User guide ..................................................................................... 44
Figure 37 User guide .................................................................................... 44
Figure 38 User guide .................................................................................... 45

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 4
Activity 1
1.1What is database?
A 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.

Figure 1 DBMS

1.2 Types of databases


There are many different types of databases. The best database for a specific
organization depends on how the organization intends to use the data.

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 5
1.2.1 Relational databases

Relational databases became dominant in the 1980s. Items in a relational


database are organized as a set of tables with columns and rows. Relational database
technology provides the most efficient and flexible way to access structured
information.

1.2.2 Object-oriented databases

Information in an object-oriented database is represented in the form of


objects, as in object-oriented programming.

1.2.3 Distributed databases

A distributed database consists of two or more files located in different sites.


The database may be stored on multiple computers, located in the same physical
location, or scattered over different networks.

1.2.4 Data warehouses

A central repository for data, a data warehouse is a type of database


specifically designed for fast query and analysis.

1.2.5 NoSQL databases

A NoSQL, or non relational database, allows unstructured and semi structured


data to be stored and manipulated (in contrast to a relational database, which defines
how all data inserted into the database must be composed). NoSQL databases grew
popular as web applications became more common and more complex.

1.2.6Graph databases

A graph database stores data in terms of entities and the relationships between
entities.

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 6
1.2.7 OLTP databases

An OLTP database is a speedy, analytic database designed for large numbers


of transactions performed by multiple users.
These are only a few of the several dozen types of databases in use today.
Other, less common databases are tailored to very specific scientific, financial, or
other functions. In addition to the different database types, changes in technology
development approaches and dramatic advances such as the cloud and automation are
propelling databases in entirely new directions. Some of the latest databases include

1.2.8 Open source databases

An open source database system is one whose source code is open source;
such databases could be SQL or NoSQL databases.

1.2.9 Cloud databases

A cloud database is a collection of data, either structured or unstructured, that


resides on a private, public, or hybrid cloud computing platform. There are two types
of cloud database models: traditional and database as a service (DBaaS). With DBaaS,
administrative tasks and maintenance are performed by a service provider.

1.2.10 Multi model database

Multi model databases combine different types of database models into a


single, integrated back end. This means they can accommodate various data types.

1.2.11 Document/JSON database

Designed for storing, retrieving, and managing document-oriented


information, document databases are a modern way to store data in JSON format
rather than rows and columns.

1.2.12 Self-driving databases

The newest and most groundbreaking type of database, self-driving databases


(also known as autonomous databases) are cloud-based and use machine learning to

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 7
automate database tuning, security, backups, updates, and other routine management
tasks traditionally performed by database administrators.
1.3 Introduction
Polly pipe is a water sports provider and installer based in Braintree,
England. Its manual database system wants to design and implement a database that
meets the data requirements as computerized system. Therefore, this system was
designed and developed the solution for water sports provider and installer to meet
their business customers. Polly pipe is maintaining their data in manual system.
Manual system is a paper record.

In computerized system control the company’s data of maintainable assets


through an asset register, easy to control Customer’s request of several installations,
but each installation is tailor-made for a specific customer can include carpenters
and masons as well as water installers, use equipment such as aquariums, air pumps
and thermostats etc. Easy to control the issues and documentation of several
installations. Database design process is,

 Requirement’s collection and analysis


 Conceptual design
 Logical design/ data model mapping
 Physical design

1.4 The user and system requirements of Polly pipe


When defining requirements, two types of requirements are served different
purposes. When identify the user requirements of the above scenario. They are,

 Functional requirements
 Non – functional requirements

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 8
1.4.1 Functional requirements

All the tasks required to upgrade the database are called functional
requirements. Updating the data required to add to the system is one of the main
requirements of the user. The customer's database should be able to enter the
customer's data from the Poly Pipe company's database. Ability to enter information
about employees, what duties they are assigned, etc. Provide the equipment needed
for an installation or order, what type of equipment the organization needs, and the
user needs to have information in the system. (Polly Pipe system should ability to
give customer details, employee details, payments, installation, equipment details.)
It should have creative interface.

1.4.2 Non – functional requirements

Non – functional requirements specify for not covered all the areas by
functional requirements. The details in system design were implement by functional
requirements. Various types of non – functional requirements are accessibility,
audit, efficiency, security, accuracy, availability, backup and restore, capacity,
certification, compliance, reliability, responsibility, virus guard, compatibility of
software.

1.4.3 System requirements

System requirements are the building blocks developers use to develop the
system. System requirements are categorized as either functional or non – functional
requirements. Functional requirements differentiate something that a user needs to
perform their work very well. For example, in the above scenario system should be
able to provide the required information for customers several installations and
handle daily operations that is functional requirements.

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 9
1.4.4 Hardware requirements and Software requirements

Figure 2 4 Hardware requirements and Software requirements

4GB Ram, HDD, SSD, Frequency 2-3.5 GHZ and more, Network interface
bandwidth 100Mbps, SSD for SQL 500Gb, Operating systems – windows
7,8,8.1,10,11
Hard disk space 350GB+, intel i7 dual core processor, Printer, Fax, scanner,
Restore and backup options, Anti-virus software.

1.5 About Polly pipe’s ER Diagram


In Polly pipe company’s customers when ordered installation it will be
installation by employees and customers pay payment. Company’s ER Diagram and
Attributes are,
1. Customer - cus_id, cus_name, cus_address, cus_contact no:
2. Employee - emp_id, emp_name, emp_address, emp_contact no: emp_types,
salary
3. Equipment – equi_id, equi_type, equi_name, equi_price, quantity
4. Installation – inst.id, inst. type, start job, end job, address
5. Payment - payment _id, paym_type, paym_date

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 10
1.5.1 Er diagram for Polly Pipe

Figure 3 Er diagram for Polly Pipe

Learner has identified the some main entities, attributes and relationships and
have drawn the ER diagram

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 11
1.5.2 This is the Logical Schema

Figure 4 Logical Schema

1.6 Data normalization


What in the first place, is normalized data? It's not hard to find a definition
of data normalization, but deciding on a particular one can be a little difficult. Data
normalization is a type of process in which data inside a database is reorganized in
such a way that users can better use that database for further queries and analysis,
taking into account all the various explanations out there.
Data normalization is a method in which data attributes are structured to
improve the cohesion of the types of entities within a data model. In other words, the

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 12
purpose of data standardization is to minimize and even eradicate data duplication,
an important factor for application developers because it is extremely difficult to
store items in a relational database that contains the same data in many locations.
The creation of clean data is commonly considered to be data normalization.
However, diving deeper, the meaning or objective of data normalization is double.
Data normalization is the arrangement of information across all documents and
fields to look identical.
It enhances the cohesion of the types of entry that lead to cleaning, lead
generation, segmentation, and data of higher quality. Simply stated, to ensure logical
data storage, this method involves removing unstructured data and redundancy
(duplicates). You will end up with structured data entry when data normalization is
performed correctly. This method refers, for instance, to how URLs, contact names,
street addresses, phone numbers, and even codes are registered. It is then possible to
group and easily read these structured information fields.
When performing the data normalization process, there are several targets in
mind. The first is to get rid of any duplicate data inside the data set that might occur.
This goes into the database essentially and removes any redundancies that can exist.
Redundancies may harm data analysis because they are values that are not precisely
required. Expunging them from the database helps, making it easier to analyze, to
clean up the data. The other aim is to group data logically. You want knowledge to
be stored together that relates to each other. In a database that has undergone data
normalization, this will occur. They should be near within the data set if data is
based on each other.
Let's take a closer look at the process itself with that general description in
mind. Although the procedure will vary depending on the type of database you have
and what type of data you gather, there are usually several steps involved. As
discussed above, one such move is the removal of duplicate data. The resolution of
any conflicting data is another step. Datasets will often have details that clash with
each other, so the normalization of data is intended to overcome this conflicting
problem and fix it before continuing. Formatting the data is the third step. This takes
information and transforms it into a format that makes it possible to do more

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 13
processing and analysis. Finally, data normalization consolidates knowledge,
merging it into a system that is far more structured.
Consider today's status of big data and how much of it is made up of
unstructured data. It is required now more than ever to organize it and transform it
into a standardized form, and data normalization helps with that effort.

1.6.1 Why Normalize Data?

There are two key benefits of using a highly structured data schema:
Increased coherence. Information is processed in one place and only in one
place, thus reducing the probability of inconsistent information.
Easier mapping of object-to-data. In general, highly-normalized data,
schemes are conceptually closer to object-oriented schemes because similar
solutions (at least from a data point of view) result from object-oriented objectives
of fostering high cohesion and loose coupling between classes.
Usually, you want to have operating data stores (ODSs) and data warehouses
(DWs) that are extremely normalized. Slower reporting efficiency is the primary
drawback of normalization. To support reporting, you would want to have a
renormalized schema, especially in data marts.

1.6.2First Ordinary Type (1NF)

Let's think of an example. The type of entity is in the first normal form (1NF)
because it does not contain any repeated data groups. In Figure 1, for example, you
see that in the data Order0NF table there are several recurring attributes-the ordered
item data repeats nine times, and the contact information is used, once for shipping
information and once for billing information. Although this initial order version
could work, what happens when there are more than nine products in an order? Do
you create for them additional order records? What about the vast majority of orders
that have just one component or two? Do we want to waste all the storage space for
the empty fields in the database? Possibly not. Also, even if it is just to marshal it

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 14
back and forth between the appropriate number of items, you want to write the code
needed to process the nine copies of item data. Again, possibly not.

1.6.3 The Second Standard Form (2NF)

An entity type is in the second normal form (2NF) when it is in 1NF, and
any attribute that is not part of the primary key is entirely dependent on the primary
key when each non-key attribute is set. This was certainly not the case with the table
of OrderItem1NF, so we need to add the new table of Item2NF. The issue with
OrderItem1NF is that information about the item, such as an item's name and price,
does not rely on the order for that item. For example, if three widgets are ordered by
Hal Jordan and five widgets are ordered by Oliver Queen, the fact that the item is
called a "widget" and that the unit price is $19.95 is constant. This information
depends on the definition of an item, not the concept of an item order, and should
therefore not be stored in the table of items ordered.

1.6.4 The Third Type of Normal (3NF)

An entity type is in the third normal form (3NF) when it is in 2NF and when
the primary key is explicitly dependent on all of its attributes. A better way to phrase
this rule may be that all parts of the primary key must depend on the characteristics
of an entity form. In this case, the problem with the OrderPayment2NF table is that
the definition of the payment form (such as 'Master card' or 'Check') depends only
on the type of payment, not the combination of the order ID and the type of
payment.

1.6.5 Fourth normal form

This is also known as the Boyce Code Normal Form (BCNF) and exists as
the fifth standard form, but in practice it is considered a coincidence. Ignoring these
rules may result in less than a complete database plan, but it does not affect
performance. For example, if think that there is a company that employs more than

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 15
one employee, can indicate that they are working in several departments of the
organization.

1.5.6 Provided logical schema normalization


Employee
ID Name Type
SHA1 Dave Clark Plumber
SHA8 John smith Installation Manager
SHA2 Freddy Davies Aquatics installer
SHA11 McCloud Aquatics installer
SHA23 Satpal Singh Plumber
SHA66 Winston Kodogo Aquatics installer
SHA55 Alison Smith Brick layer
Table 1 Normalization

Employee
ID Name
SHA1 Plumber
SHA8 Installation Manager
SHA2 Aquatics installer
SHA11 Aquatics installer
SHA23 Plumber
SHA66 Aquatics installer
SHA55 Brick layer
Table 2 Normalization

1.5.7 What is validation?


Data validation is important in data processing, analysis, data verification
and data processing. It is important to verify any data before use. Making decisions
based on flawed data is risky. Therefore, any organization in the world has its own

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 16
set of rules for storing and maintaining its corporate data. Examples of data
validation rules ,

 Data type (ex. integer, float or string)


 Range check (ex. A number between 10-50)
 Uniqueness (ex. Postal code)
 Consistent expressions (ex. Using one of St., Str, Street)
 No null values

1.5.7.1 Data validation

 Insert
 Update
 Delete

1.5.7.1.1 Insert Data

Figure 5 Insert Data

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 17
1.5.7.1.2 Update Data

Figure 6 Update Data

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 18
1.5.7.1.3 Delete Data

Figure 7 Delete Data

Activity 2
2.1 This is about the Interface of Polly pipe
This interface design is to get main idea of system for the user. It can be designed on
wireframe or any interface designing tool. Polly pipe company has 7 interface forms
that author created. They are,
Login form
Main form
Employee form
Customer form
Installation form
Equipment form
Payment form

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 19
2.1.1 Login form

Polly Pipe company system main interface is Login form. It is design on simple
interface include username and password.

Figure 8 Login Form

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 20
2.1.2 Main Form

Figure 9 Main form

2.1.3 Employee details form

Figure 10 Employee form

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 21
2.1.4 Customer details form

Figure 11 Customer Details

2.1.5 Installation details form

Figure 12 Installation details form

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 22
2.1.6 Equipment details form

Figure 13 Equipment

2.1.7 Payment details form

Figure 14 Payment form

2.2 What is SQL?


SQL is a structured query language. It is a computer language for storing,
manipulating, and retrieving data stored on a relational database. A database is a table

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 23
that includes rows and columns. SQL mainly targeting understand and analyze of
databases include data tables. For a example, A company had a many data to be
stored. Already Company has a departments and gathered data on it . At that time
company place a SQL for stored their database.
Importance of SQL
1. SQL is a global language.
2. SQL is a open source language and that can be use easily to user or learner.
3. Mainly SQL have managed billions of data in world.
4. SQL even use on smart devices and use iOS and android.
5. Many global companies place sql at their demand.

2.3 What is DDL Statements?


SQL has 6 sublanguages.
 DDL – Data Definition Language.
 DML – Data Manipulation Language.
 DRL/DQL – Data Retrieval Language/Data Query Language
 TCL – Transaction Query Language.
 DCL – Data Control Language.
 SCL – Session Control Language.

2.3.1 DDL

DDL can change commands automatically. It’s permanently saved in the database.
DDL does things like create tables and delete tables. DDL as a command,
 DROP
 ALTER
 CREATE
 TRUNCATE

Create used
Syntax

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 24
 CREATE TABLE TABLE_NAME (COLUMN_NAME
DATATYPES[,….]);

Example

CREATE TABLE CUSTOMER(Name VARCHAR2(50), ADDRES VARCHAR


2(100), DOB DATE);
Usage of DDL
The key here is the ability to create tables and manage created tables using data
definition language. Create a new tables, structured and recorded stored create in table
and also delete structured data and stored on table in database and used to add new
attributes in database.

Drop used
Syntax
 DROP TABLE table__name;

Example
DROP TABLE PAYMENT;

Alter used
Syntax
 ALTER TABLE table _name ADD column__name COLUMN-definition;

Example
 ALTER TABLE CUS_DETAILS ADD(ADDRESS VARCHAR2(50));
 ALTER TABLE CUS_DETAILS MODIFY (NAME VARCHAR2(50));

Truncate used
Syntax
 TRUNCATE TABLE table_name;
Example:

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 25
TRUNCATE TABLE CUSTOMER;

2.3.2 DML

DML is used to modify databases. But DML cannot execute automatic commands
like DDL. Data can be reversed via DML. Here are under DML commands,
 INSERT
 UPDATE
 DELETE
Insert used
Syntax
 INSERT INTO TABLE_NAME 2. VALUES (value1, value2, value3, ....
valueN);
For example:
INSERT INTO Employee (Address, Name) VALUES ("oak street", "sally dench");

Update used
Syntax:
 UPDATE table_name SET [column_name1= value1,...column_nameN =
valueN] [WHERE CONDITION]
For example:
1. UPDATE Installation
2. SET Name = 'Marine'
3. WHERE Installation__Id = '767'

DELETE USED
Syntax:
 DELETE FROM table _name [WHERE condition];
For example:
1. DELETE FROM Payment
2. WHERE PaymentID="22";

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 26
2.4 Commands which used for Polly pipe database system:

2.4.1 Select command

Figure 15 Select

Figure 16

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 27
2.4.2 Update Command

Figure 17 Update

Figure 18

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 28
2.4.3 Delete Command

Figure 19 Delete

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 29
2.5 Polly pipe company system

2.5.1 Login form

Figure 20 Login form

2.5.2 Employee details form

Figure 21 Employee details form


Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|
ID : Kan-00142214 Page 30
2.5.3 Customer details form

Figure 22 Customer details form

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 31
2.5.4 Equipment details form

Figure 23 Equipment details form

2.5.5 Installation details form

Figure 24 Installation details form

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 32
2.5.6 Payment details

Figure 25 Payment details

2.6 Database security


Database security can protect confidentiality, integrity and availability of data.
Database security is secure database from threats. Database security threats in
following situation,

 Theft fraudulent
 Confidentiality loss
 Data privacy loss
 Integrity loss
 Data availability loss

Types pf Database security mechanisms are,


 Access controls
 Views
 Data integrity
 Encryption of data

Access control

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 33
Access control can protect database on unauthorized access.
Data encryption
Encryption give protection on sensitive data communicate on public networks.
2.7 SQL statements
These are Select, where, update, Between, in, Group By, Order By statements.

2.7.1 ‘Select’ SQL Statement

Figure 26 select

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 34
Figure 27

2.7.2 ‘Where’ statement

Figure 28 ‘Where’ statement

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 35
Figure 29

2.7.3 ‘Update’ statement

Figure 30 ‘Update’ statement

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 36
Figure 31

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 37
2.7.4 ‘Between’ statement

Figure 32 ‘Between’ statement

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 38
2.7.5 ‘In ’ Statement

Figure 33 ‘In ’ Statement

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 39
2.7.6 ‘Group by’ statement

Figure 34 Group statement

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 40
2.7.7 ‘Order by’ statement

Figure 35 ‘Order by’ statement

Activity 3
Test the systems against user and system requirements

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 41
3.1 Test plan
Database Testing can check schemas, tables etc. of the database. Database system
testing is effectively and validate to ensure quality of the system.

Test case – 01
Test case – Enter incorrect username or password
Test name – Udesh Ishanka

Test case Input data Expected Actual result Test result


result (Pass /Fail)
Enter incorrect Username – Login not Login not Pass
username and England success! success!
password Password –123
Table 3 Test case01

Test case – 02
Test case – Enter correct username and incorrect password
Test name – Udesh Ishanka

Test case Input data Expected Actual result Test result


result (Pass /Fail)
Enter correct Username – Login not Login not Pass
username and Polly pipe success! success!
incorrect Password –
password Admin
Table 4 Test case 02

Test case – 03
Test case – Enter correct username and correct password
Test name – Udesh Ishanka
Test case Input data Expected Actual result Test result
result (Pass /Fail)
Enter correct Username – Login Login Pass
username and Polly pipe Success ! success !
correct Password –
password Admin123
Table 5 Test case 03

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 42
3.2 Test procedure
Interface testing
Test case Input data Tester name Test date
01 Enter incorrect Udesh Ishanka 02 nd of December
username and 2022
password
02 Enter correct Udesh Ishanka 02 nd of December
username and 2022
incorrect password
03 Enter correct Udesh Ishanka 02 nd of December
username and 2022
correct password
Table 6 Test procedure

3.3 Database testing


Database testing
01 Select Udesh Ishanka 02 nd of December
2022
02 Where Udesh Ishanka 02 nd of December
2022
03 Update Udesh Ishanka 02 nd of December
2022
04 Between Udesh Ishanka 02 nd of December
2022
05 In Udesh Ishanka 02 nd of December
2022
06 Group By Udesh Ishanka 02 nd of December
2022
07 Order By Udesh Ishanka 02 nd of December
2022
Table 7 Database Testing

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 43
Activity 4
4.1 Produce technical and user documentation

4.1.1 Technical and user documentation

User Manual

Figure 36User guide

Figure 37 User guide

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 44
Figure 38 User guide

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 45
References
www.javatpoint.com. 2022. SQL Commands: DDL, DML, DCL, TCL, DQL -
javatpoint. [online] Available at: https://www.javatpoint.com/dbms-sql-command
[Accessed 02 December 2022].

Safe Software. 2022. What is Data Validation? How It Works and Why It's Important.
[online] Available at: https://www.safe.com/what-is/data-validation/
[Accessed 02 December 2022].

Watt, A., 2022. Chapter 12 Normalization. [online] Opentextbc.ca. Available at:


https://opentextbc.ca/dbdesign01/chapter/chapter-12-normalization/
[Accessed 02 December 2022].

p.com. 2022. [online] Available at:


https://phoenixnap.com/kb/wpcontent/uploads/2021/07/how-a-dbms-works.png
[Accessed 02 December 2022].

Oracle.com. 2022. What is a database?. [online] Available at:


https://www.oracle.com/database/what-is-database/
[Accessed 02 December 2022].

Name :N.M Udesh Ishanka |Subject : Database | Assignment No : 01|


ID : Kan-00142214 Page 46

You might also like