Sunteți pe pagina 1din 21

HANWELL PEST CONTROL

Contents
Introduction: .................................................................................................................................... 2
Task-1 ............................................................................................................................................. 3
Part-1 ........................................................................................................................................... 3
List of Entity- .......................................................................................................................... 3
The Entity Relationship Diagram ........................................................................................... 3
Part-2 ........................................................................................................................................... 4
Data Dictionary ....................................................................................................................... 4
Task-2 ............................................................................................................................................. 5
Creating, Inserting and Showing Table-(Implementation and Data) .......................................... 6
All Queries shown below-(Queries) ......................................................................................... 12
Task-3 ........................................................................................................................................... 15
Derived Data- ............................................................................................................................ 15
Task-4 ........................................................................................................................................... 19
Evaluation- ................................................................................................................................ 19
Requirements on Assignment- .............................................................................................. 19
Solution on Requirement ...................................................................................................... 19
Solutions steps ...................................................................................................................... 20
Conclusion: ................................................................................................................................... 21

DDD L5DC Page 1


HANWELL PEST CONTROL

Introduction:
This assignment is on Hanwell Pest Control Company. They are special to the people for
controlling and extermination of pests. This assignment has four parts- design, data and queries
and derived data and evaluation. The whole parts are essential to complete the full job.

DDD L5DC Page 2


HANWELL PEST CONTROL

Task-1
Part-1

List of Entity-

1. Job
2. Customer
3. Equipment
4. Staff
5. Job_Type
6. Job_Equipment
7. Staff_Job

The Entity Relationship Diagram

DDD L5DC Page 3


HANWELL PEST CONTROL

Part-2

Data Dictionary

DDD L5DC Page 4


HANWELL PEST CONTROL

Figure-Data Dictionary

DDD L5DC Page 5


HANWELL PEST CONTROL

Task-2
Creating, Inserting and Showing Table-(Implementation and Data)

CREATE DATABASE IF NOT EXISTS `Database hanwell_pest `;

USE ` Database hanwell_pest `;

SQL Command for Customer table

Insert into Customer table-

Output of customer table-

DDD L5DC Page 6


HANWELL PEST CONTROL

SQL Command for Job_Equipment table

Insert into Job_Equipment

Output of Job_Equipment-

DDD L5DC Page 7


HANWELL PEST CONTROL

SQL Command for Job_Type table

Insert into Job_Type table-

Output of Job_Type table-

SQL Command for Staff_Job table

DDD L5DC Page 8


HANWELL PEST CONTROL

Insert into Staff_Job table-

Output of Staff_Job table-

SQL Command for Job table-

DDD L5DC Page 9


HANWELL PEST CONTROL

Insert into job table-

Output of Job table-

SQL Command for Staff table-

Insert into Staff table-

DDD L5DC Page 10


HANWELL PEST CONTROL

Output for Staff table-

SQL Command for Equipment table-

Insert into Equipment table-

Output of Equipment table-

DDD L5DC Page 11


HANWELL PEST CONTROL

All tables are shown here-

All Queries shown below-(Queries)

Q7-Code

Q7-Result

DDD L5DC Page 12


HANWELL PEST CONTROL

Q8-Code

Q8-Result

Q9-Code

Q9-Result

DDD L5DC Page 13


HANWELL PEST CONTROL

Q10 code-

Q10 result-

Q11 Code-

Q11 result-

Q12 code-

DDD L5DC Page 14


HANWELL PEST CONTROL

Q12 result-

Task-3
Derived Data-
Firstly, I have altered the table on job_equipment. Here I added a column name Costing.

Alter table-

Then I have updated the job_equipment table on costing column. I have done this 5 times for
5 values inserting. Here is the only 1 example-

DDD L5DC Page 15


HANWELL PEST CONTROL

Update-1

Here is the all updating on costing-

Now there will be change in charging system for staffs.

For this, I have to alter another column name equipment_number in job_equipment.

Here is the update example on equipment_number-

After update on equipment_number-

DDD L5DC Page 16


HANWELL PEST CONTROL

DDD L5DC Page 17


HANWELL PEST CONTROL

Now I have shown here the latest charging system. Thats why I have calculated the equipment
number and costing of that equipment. Now all charged will be counted via piece of equipment.
There is the sql code of charging of staffs-

Charging of staffs in new method--

DDD L5DC Page 18


HANWELL PEST CONTROL

Task-4
Evaluation-

Requirements on Assignment-
1. To produce an entity relationship model for Hanwell Pest Control.
2. It should be normalized model to 3rd normal form.
3. A data dictionary for the entity relationship model.
4. Creating all tables using SQL
5. Input data on jobs.
6. Input data on members of staff.
7. Input data on equipment and materials that are used on job.
8. Query on Selects all the jobs and which staff have worked on them.
9. Query on Selects equipment and materials that are used on jobs of type Wasp Nest.
10. Query on Selects all the jobs that Muhammad Ya has worked on.
11. Query on Shows all jobs in Essex.
12. Query on counting the number of jobs that have used Wainscot Seals.
13. Query on Prepare an invoice including vat charge.
14. I have to show the altered table code in Sql.
15. Change the charging systems for staffs and to show the sql code.
16. Evaluate the whole assignment how I have done it. And how I have standardized the
companys data.

Solution on Requirement
1. I have tried to identify the requirements.
IDENTIFY
2. I analysis on the entire requirements on assignment.
3. I made some rough on entity model and finding entity.
4. I have made all the tables using mySql. EXPLORE
5. After that I run query on them.
6. I was made some wrong whenever I was making tables
SET GOAL
and queries.
7. But I was successful to show all the queries which were
required. IMPLEMENT
8. I was able to change the charging system by altering table.
EVALUATE

Solution Method

DDD L5DC Page 19


HANWELL PEST CONTROL

Solutions steps

Task-1:
1. I have shown an entity relationship model with entity.
2. I have also made a data dictionary for this Model.

Task-2:
Data-

1. All tables were created by mySql. I have also shown created scripts and finished tables.
2. I have entered data for all jobs and provided a list.
3. I have entered data for all staffs and provided a list.
4. I have entered data on equipment and provided a list.

Queries-

1. I have shown a query that shows all the jobs and which staff have worked on them.
2. I have shown query that selects the equipments and materials that are used on jobs of type
Wasp Nest.
3. I have shown a query that selects all the jobs that Muhammad Ya has worked on.
4. I have shown query that all jobs have taken in place named Essex.
5. I have shown query that counts the number of jobs that have used by Wainscot Seals.
6. I have made an output of an invoice including vat.

Task-3:

Deriving Data-

Company would like to change their charge systems for jobs. I have shown here how to change
the charge systems on particular piece of equipment they use. Thats why I have altered the table
with new column. Then I have calculated the equipment number with costing of equipments.

Task-4:
Standardizing Companys Data-

Previously they had charged on the per day job type. I have shown them a way altering table into
charging on equipment. By this way, they are now standardized company on charging system.

All data storage and applications are attached in file and CD.

DDD L5DC Page 20


HANWELL PEST CONTROL

Conclusion:
I have tried to fulfill all the requirements on assignments. There may have some wrong by
myself. But I will try to recover all my faults. I have learnt a huge knowledge by completing this
assignment. Now I hope so that I can perform part time job in a company on database.

DDD L5DC Page 21

S-ar putea să vă placă și