Docsity

Database Design and Implementation for Polly Pipe, High school final essays of Computer science

Toggle sidebar
bg1
Database Design and Development
for Polly Pipe
Higher National Diploma in Computing
Unit 4: Database Design & Development
Assignment 01
Introduction
Polly Pipe is a water sports provider and installer based in Braintree,
England. They require a database system to manage their business
operations, including customer installations, staff management, and
equipment tracking. This assignment focuses on designing and
implementing a relational database system to meet Polly Pipe's data
requirements.
LO1: Use an appropriate design tool to design
a relational database system for a substantial
problem
Polly Pipe's data requirements can be summarized as follows:
Customers
Customers can request multiple installations, each of which is tailored
to their specific needs.
Facilities
Facilities are classified by type (e.g., aquarium, pool, etc.).
One or more employees are assigned to each facility.
Facilities can include various types of workers, such as carpenters,
masons, and water installers.
Facilities use different types of equipment, such as aquariums, air
pumps, and thermostats.
Facilities may have multiple computers.
Staff Management
Polly Pipe maintains records of their staff, including their name, type
(e.g., plumber, installation manager, etc.), and a unique SHA identifier.
•
•
•
•
•
•
•
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Database Design and Implementation for Polly Pipe and more High school final essays Computer science in PDF only on Docsity!

Database Design and Development

for Polly Pipe

Higher National Diploma in Computing

Unit 4: Database Design & Development

Assignment 01

Introduction

Polly Pipe is a water sports provider and installer based in Braintree, England. They require a database system to manage their business operations, including customer installations, staff management, and equipment tracking. This assignment focuses on designing and implementing a relational database system to meet Polly Pipe's data requirements.

LO1: Use an appropriate design tool to design

a relational database system for a substantial

problem

Polly Pipe's data requirements can be summarized as follows:

Customers

Customers can request multiple installations, each of which is tailored to their specific needs.

Facilities

Facilities are classified by type (e.g., aquarium, pool, etc.). One or more employees are assigned to each facility. Facilities can include various types of workers, such as carpenters, masons, and water installers. Facilities use different types of equipment, such as aquariums, air pumps, and thermostats. Facilities may have multiple computers.

Staff Management

Polly Pipe maintains records of their staff, including their name, type (e.g., plumber, installation manager, etc.), and a unique SHA identifier.

Equipment

Polly Pipe uses various types of equipment, such as tanks, thermostats, air pumps, and filters, with different models and sizes.

To design a relational database system that meets these requirements, an appropriate design tool, such as a database management system (DBMS) or a data modeling software, can be utilized. The database design should include the following components:

Entity-Relationship (ER) Diagram : The ER diagram should visually represent the entities (e.g., Customers, Facilities, Staff, Equipment) and their relationships. Logical Data Model : The logical data model should define the tables, their attributes, and the relationships between them. Physical Data Model : The physical data model should translate the logical data model into a specific DBMS implementation, such as SQL Server or MySQL.

The database design should ensure data integrity, minimize data redundancy, and provide the necessary functionality to support Polly Pipe's business operations.

LO2: Develop a fully functional relational

database system, based on an existing system

design

Based on the database design developed in LO1, the next step is to implement a fully functional relational database system. This includes the following tasks:

Database Implementation : Create the database schema, including tables, relationships, and constraints, using a DBMS such as SQL Server or MySQL. Data Population : Populate the database with the sample data provided in the assignment brief, as well as any additional data required to demonstrate the system's functionality. Database Queries : Develop SQL queries to perform various operations, such as inserting, updating, deleting, and retrieving data from the database. Application Integration : Integrate the database system with a front- end application or user interface to provide a seamless user experience for Polly Pipe's staff.

The developed database system should be fully functional, meeting the requirements specified in the assignment brief and demonstrating the ability to manage Polly Pipe's data effectively.

Relational Database System for the above

scenario

1.1.2 Entity Relationship Diagram (ERD)

The Entity Relationship Diagram (ERD) depicts the relationships between the various entities involved in the given scenario. The key entities are:

Installation : Represents the installation details, including the installation type, start date, and end date. Staff : Represents the staff members involved in the installations, including their names, email addresses, staff types, and the associated installation. Customers : Represents the customers who have requested the installations, including their names, contact information, and the associated installation address and ID. Equipment : Represents the equipment used in the installations, including the equipment type, name, and the associated installation. Payment : Represents the payment details for the installations, including the customer ID, amount, and the associated installation.

The relationships between these entities are as follows: - Each installation can have multiple staff members assigned to it. - Each installation can have multiple customers associated with it. - Each installation can have multiple pieces of equipment associated with it. - Each installation can have multiple payments associated with it.

1.1.3 Relational Database Design

Based on the ERD, the relational database design can be represented as follows:

Table 2: Relational Database

| Entities | Attributes | | --- | --- | | Installation | ins_id, ins_type, start_date, end_date | | Staff | st_no, st_name, email, st_type, ins_id | | Customers | cus_id, f_name, l_name, con_no, email, ins_address, ins_id | | Equipment | eq_id, eq_type, eq_name, ins_id | | Payment | pay_no, cus_id, amount, ins_id |

The key points of the relational database design are:

Each entity is represented as a table with its respective attributes. The primary keys for each table are ins_id, st_no, cus_id, eq_id, and pay_no.

The foreign keys are used to establish the relationships between the tables, such as ins_id in the Staff, Customers, Equipment, and Payment tables.

1.1.4 Normalization

Normalization is the process of organizing data in a database to reduce redundancy and improve data integrity. The given relational database design can be further normalized to eliminate potential anomalies.

First Normal Form (1NF) : The initial relational database design is already in the First Normal Form, as it does not contain any repeating groups.

Second Normal Form (2NF) : The database is in the Second Normal Form, as all the non-key attributes are fully dependent on the primary key.

Third Normal Form (3NF) : The database is in the Third Normal Form, as there are no transitive dependencies. All the non-key attributes are directly dependent on the primary key and not on any other non-key attributes.

Boyce-Codd Normal Form (BCNF) : The database is also in the Boyce- Codd Normal Form, as there are no partial dependencies and all the determinants are candidate keys.

In summary, the provided relational database design is already in a normalized state, and no further normalization is required.

Boyce-Codd Normal Form (BCNF or 4NF)

Boyce-Codd Normal Form, also known as the 3.5 Normal Form, is a higher level of normalization that ensures a table is free from all partial and transitive dependencies. In BCNF, the determinant is a candidate key.

Example: EMPLOYEE Table

| EMP_Id | EMP_Country | EMP_Dept | DEPT_Type | EMP_Dept_No | | ------ | ----------- | -------- | ---------- | ----------- | | 264 | India | Designing| D394 | 283 | | 264 | India | Testing | D394 | 300 | | 364 | UK | Stores | D283 | 232 | | 364 | UK | Developing| D283 | 549 |

Related Tables

| EMP_COUNTRY Table | EMP_DEPT Table | | ----------------- | -------------- | | EMP_Id | EMP_Country | EMP_Dept | DEPT_Type | EMP_Dept_No | | ------ | ----------- | -------- | ---------- | ----------- | | 264 | India | | | | | 364 | UK | | | |

EMP_DEPT_MAPPING Table

| EMP_Id | EMP_Dept | | ------ | -------- | | 264 | 283 | | 264 | 300 | | 364 | 232 | | 364 | 549 |

Number | -| PK | | Cus_id | Int | Customer Id | - | FK | | Amount | Int | Paid Amount | - | - | | Ins_id | Int | Installation Unique Id | - | FK |

Simple Interfaces using Wireframe

A wireframe is a design tool used to create the basic structure and layout of a website or application. It helps visualize the content, navigation, and functionality of the system.

Login and Registration Page

The login and registration page allows users to sign in to the system or create a new account.

Main Menu

The main menu provides access to the various functionalities of the system, such as customer details, staff details, installation details, equipment details, and payment details.

Customer Details

The customer details page allows users to view and manage customer information, including contact details and installation information.

Staff Details

The staff details page allows users to view and manage staff information, including contact details and employment details.

Installation Details

The installation details page allows users to view and manage installation information, including contract details and equipment details.

Equipment Details

The equipment details page allows users to view and manage equipment information, including equipment types and serial numbers.

Login Form Registration Form

Main Menu

Customer Details

Staff Details

Installation Details

Equipment Details

Payment Details

The payment details page allows users to view and manage payment information, including customer payments and installation-related payments.

Constraints

Constraints are used to ensure the integrity and validity of data in a relational database. There are several types of constraints:

Not Null

The not null constraint ensures that a column cannot hold a null or empty value.

sql CREATE TABLE Job ( Job_ID int NOT NULL, Job_title varchar(255) NOT NULL, Invoice_no int NOT NULL );

Unique

The unique constraint ensures that each value in a column is unique.

sql CREATE TABLE Job ( Job_ID int NOT NULL UNIQUE, Job_title varchar(255) NOT NULL, Invoice_no int NOT NULL );

Check

The check constraint ensures that the value in a column meets a specific condition or range.

sql CREATE TABLE Job ( Job_ID int NOT NULL UNIQUE, Job_title varchar(255) NOT NULL, Des_km int CHECK (km >= 150) );

Primary Key

The primary key constraint ensures that a column or a combination of columns uniquely identifies each row in a table.

sql CREATE TABLE Job ( Job_ID int NOT NULL PRIMARY KEY, Job_title varchar(255) NOT NULL, Des_km int CHECK (km >= 150) );

Payment Details

Not Null Statement

Primary Key

Create Staff table

Figure 18 demonstrates the creation of the Staff table, which presumably contains data about the employees or personnel involved in the organization.

Create Customer table

Figure 19 illustrates the creation of the Customer table, which stores information about the customers or clients of the organization.

Create Equipment table

Figure 20 depicts the creation of the Equipment table, which may hold details about the various equipment or products offered by the organization.

Create Payment table

Figure 21 shows the creation of the Payment table, which likely records information about the payments made by customers or clients.

Insert data into Installation Table

Figure 22 demonstrates the insertion of data into the Installation table.

Insert data into Staff Table

Figure 23 shows the insertion of data into the Staff table.

Insert data into Customer Table

Figure 24 illustrates the insertion of data into the Customer table.

Insert data into Equipment Table

Figure 25 depicts the insertion of data into the Equipment table.

Insert data into Payment Table

Figure 26 shows the insertion of data into the Payment table.

Provide evidence of the use of a suitable IDE to create a

simple interface

This section discusses the use of Microsoft Visual Studio as an integrated development environment (IDE) for creating computer programs, websites, online applications, and mobile apps. Visual Studio supports various programming languages and allows code editors and debuggers to work with any programming language, including C++, C#, JavaScript, Python, and others. The document mentions the different editions of Visual Studio, such as Professional, Enterprise, and Community.

Evaluate the database solution developed and its

effectiveness

This section focuses on the evaluation of the database solution developed, considering the user and system requirements, system security mechanisms (such as user groups and access permissions), and the maintenance of the database.

The document discusses various security mechanisms for databases, including: - Access control - Auditing - Authentication - Encryption - Integrity controls - Backups - Application security

The section also provides an overview of data manipulation language (DML) and its various statements, such as SELECT, WHERE, UPDATE, BETWEEN, IN, GROUP BY, ORDER BY, and HAVING.

Schedule & Estimation

Determine Test Deliverables

Introduction

The purpose of the Polly Pipe database is to enter, retrieve, and delete data about the customers, staff, installation, equipment, and payment. The facility should be able to enter all the details using Polly Pipe. The purpose of the test plan is to test:

What happens if additional data are added to the tables? What happens if data types are entered into the system incorrectly? Whether data can be inserted into the system. Whether data can be updated. Whether data can be deleted from the system.

Tasks

Check whether the system gives an error message when trying to delete data from a non-existing table in the database. Check whether a value is updated. Check whether an error message is represented. Check whether a created table is in the system. Check whether deleted data still exist.

Requirements

User Requirements

User requirements, often referred to as user needs, describe what the user does with the system, such as what activities that users must be able to perform. User requirements are generally documented in a User Requirements Document (URD) using narrative text. User requirements are

Staff table with correct SQL syntax | Delete "SHA4" from the Staff table | The system should give a success message as the output | A success message was shown | PASS | Safwan | - | | 005 | Enter a null value to a foreign key field | Insert a null value to the Staff table ins_id field with correct SQL syntax | ins_id – "654" | The system should give a failure message as the output | A failure message was shown | PASS | Safwan | - |

Feedback Form

[Feedback Form Image]

User's Guide

This is the Polly Pipe automated system for operational activities. The user's guide will help you to work with the system.

Login Page

[Login Page Image]

This is the welcome page which will be shown soon after you run the program. If you are an existing user:

Enter your User ID. Enter your Password. Click the "Login" button.

If you are a new user:

Click the "Register" button. Fill in the registration form. Click the "Submit" button.

After logging in, you will be directed to the main menu, where you can perform various operations such as managing customers, staff, installations, equipment, and payments.

User Guide

Sign Up Page

This is the new account page for new registration. Enter your details correctly, create a new password and remember the password for your sign in purpose.

Main Menu Page

On this page, you can choose what page you want open next.

Customer Details Page

This is the Customer Details page for inserting, updating, and deleting the details of customers. Enter the details correctly and click on the "INSERT" button to add details to the database. Re-type the details and click on the "UPDATE" button to update details on the database. Type Customer ID and click on the "DELETE" button to delete details from the database. Click on the "VIEW" button to view details on the Data Grid View.

Staff Details Page

This is the Staff Details page for inserting, updating, and deleting the details of staff. Enter the details correctly and click on the "INSERT" button to add details to the database. Re-type the details and click on the "UPDATE" button to update details on the database. Type Staff No. and click on the "DELETE" button to delete details from the database. Click on the "VIEW" button to view details on the Data Grid View.

Installation Details Page

This is the Installation Details page for inserting, updating, and deleting the details of installation. Enter the details correctly and click on the "INSERT" button to add details to the database. Re-type the details and click on the "UPDATE" button to update details on the database. Type Installation ID and click on the "DELETE" button to delete details from the database. Click on the "VIEW" button to view details on the Data Grid View.

Equipment Details Page

This is the Equipment Details page for inserting, updating, and deleting the details of Equipment's. Enter the details correctly and click on the "INSERT" button to add details to the database. Re-type the details and click on the "UPDATE" button to update details on the database. Type Equipment No. and click on the "DELETE" button to delete details from the database. Click on the "VIEW" button to view details on the Data Grid View.

Payment Details Page

This is the Payment Details page for inserting, updating, and deleting the details of payments. Enter the details correctly and click on the "INSERT" button to add details to the database. Re-type the details and click on the "UPDATE" button to update details on the database. Type Payment No. and click on the "DELETE" button to delete details from the database. Click on the "VIEW" button to view details on the Data Grid View.

Diagrams for the System

Use Case Diagram

Flow Charts

System Login

Insert New Data

Update Data

Delete Data

Select Data

Future Improvements to the Database System

To improve this database system in the future, the following suggestions could be implemented:

Database Archiving could be implemented to help save storage space and reduce the amount of unused data stored. The system could facilitate more types of reporting functionalities for future decision-making operations. The system could include the use of notification facilities for certain operations such as when a job is ready to be dispatched. The database system currently only has Admin access and could be improved to allow multi-level user access. Automated error handling is not currently implemented in the database system and could be added in the future to provide clients easy solutions to errors.

Gantt Chart

Use Case Diagram

System Login Flow Chart

Insert New Data Flow Chart

Update Data Flow Chart

Delete Data Flow Chart

Select Data Flow Chart

Gantt Chart