Cycle Shop Database
Cycle Shop Database
Submitted by:
Muhammad Ihtisham
Mustaneer Haider
Shahab Shah
Supervised by:
Mr. Babar Zeb
2
Contents
Introduction.................................................................................................................................................3
Problems with existing Database.................................................................................................................4
Interviews to gather Information.................................................................................................................5
Mission Statement.......................................................................................................................................6
Mission Objectives......................................................................................................................................7
Identifying Entities......................................................................................................................................9
Identifying Attributes and Keys.................................................................................................................10
Identifying Relationship............................................................................................................................11
E-R Model.................................................................................................................................................14
Implementation in MySQL........................................................................................................................15
3
Introduction
"Cycling World Peshawar" is a cycle shop located in Peshawar, it has
been open for years. Ijaz, The owner of the shop has been conducting
his daily business on sheets of paper. he maintains information about
sales, employees, customers and suppliers on sheets of paper. Because
of this, Ijaz spend a lot of time in maintaining his data.
Recently, Ijaz learned that by using database he could easily store and
work with the data related to his business. Using database will also
reduce the time he spend on maintaining data and he can make sure
that the data is accurate and up-to-date.
4
here are some of the main problems faced by the shop owner:
Database Designer: “I’m sure the database will address those issues.
Now, what would you say is the single most important function of your
business?”
Database Designer: “Can you give me an idea of the things you’d like to
track in the database?”
Database Designer: “Is there anything else that you can think of that is
related to these subjects?”
Database Designer: “What about the sales reps involved in each sale?”
After analyzing the current Database and the gathered information, now we can
define mission statement and mission objectives for our project.
Mission Statement
The purpose of the Cycle Shop database is to maintain the data
needed to support the business and related customer service
operations.
7
Mission Objectives
1. Maintain complete inventory information.
2. Maintain complete customer information.
3. Track all customer sales.
4. Maintain complete supplier information.
5. Maintain complete employee information.
8
Identifying Entities
Entities:
1. Customers
2. Employees
3. Invoices
4. Products
5. Vendors
10
Table Structures
Province City
Zip_Code Province
11
Identifying Relationship
E-R Model
15
Implementation in MySQL
CREATE TABLE Customers (
Customer_ID int NOT NULL,
First_Name VARCHAR(20),
Last_Name VARCHAR(20),
Phone VARCHAR(15),
Street VARCHAR(20),
City VARCHAR(20),
Province VARCHAR(20),
Zip_Code VARCHAR(10),
PRIMARY KEY (Customer_ID)
);
16