You are on page 1of 37

The bond between successful business and

efficient databases is behind a door.


Be sure to knock at us!

Alex, Ioli, Dan and Joanne


Project manager: Emanuela Cerchez
PIM Copy Center
We have studied the PIM Copy Center business
in order to model an efficient database to suit its
needs.
PIM Copy Center.
References

• PIM Copy Center website


www.pimcopy.ro

• Interview with
Andrei Tudorean, PIM Copy Center manager
Phone: +40 232 261 851
Mobile phone: +40 788 332 831
Email: andrei@pimcopy.ro

• FedEx Kinko’s – Office and Print Services


In order to find a similar business, visit the “In-Store
Services” section of www.fedex.com/us/officeprint/main/
PIM Copy Center. Business
needs

• PIM Copy Center is a grown business that has


5 copy centers in Iaşi and two in other cities. One of the
copy centers is also a typography. We need to track data
about these centers and about the employees that work
there.
• Among with copy services, PIM sells different kinds of
products like blank paper, staples, blank CDs and so on.
We need to know the quantity in stock of these products
and track this data in time.
• PIM also handles orders from clients, for either copy
centers or the typography. We need to be able to access
details and status about these orders.
• We therefore need an efficient, well organized database.
Information
Requirements

• Business’s employees work in copy centers, make the


use of specialized equipment, interact with different
kinds of clients.
• Each copy center has an employee responsible of it.
• Each employee is paid a salary every two weeks. The
salary is preset at hiring, according to his schedule, and
may be recalculated when he changes his schedule.
Employees’ extra hours and penalties modify the salary.
• Employees work in shifts which are scheduled every
week. For every employee we set a personal schedule.
We don’t need to keep track of schedules longer than
four weeks.
Information
Requirements

• Although we have many kinds of equipment we only


need to track data about printers and computers.
• We’re only interested in some of the computer
components. For printers we need to remember changes
for basic components.
• All the copy centers are supplied by one storehouse. We
must also know every company that provides our
storehouse with materials and the buying price of those
materials.
Information
Requirements

• We keep track of incoming/outgoing materials and


product from copy centers and storehouse.
• The business provides a set of services that may or
may not involve the products from the stock of one copy
center.
• Clients use the services via orders. We only keep track
of the orders that can’t be handled immediately,
therefore we remember only the clients who place this
kind of orders.
• We need to mention that there are two types of orders
as the business also provides typography services.
Structural Rules: Employees. Clients.
Orders

• For each EMPLOYEE we need to know their first name,


last name, address, contract number, ID card number,
birth date, mobile phone number, home phone number,
civil status, studies, professional experience,
psychological evaluation, qualification, availability.
We assign an artificial id to each EMPLOYEE.
• For each CLIENT we need to know their first name and
last name and the ID card number.
• EMPLOYEEs may receive or handle ORDERs. CLIENTs
place ORDERs. We don't keep track of CLIENTs that
don't place any ORDERs.
Structural Rules: Employees. Clients.
Orders

• For each ORDER we need to know the date and time


(as part of the unique identifier) it was requested,
number of copies ordered. And order must be
REGULAR or TYPOGRAPHY. For each TYPOGRAPHY
ORDER we keep track of its due date.
• Each TYPOGRAPHY ORDER may be assigned one or
more PARTs OF ORDER. Each PART OF ORDER has
a date time attribute (as part of the unique identifier) and
a quantity telling how many copies were given to the
CLIENT.
ERD: Employees. Clients.
Orders
CLIENT
# ID card no
* first name
* last name
place

placed by

ORDER
# date time
* copies no
REGULAR
receive
EMPLOYEE
# id received by
* first name handle PART OF
* last name TYPOGRAPHY assigned
ORDER
* address handled by # date time
of
(#1) contract no * quantity
(#2) ID card no
* birth date
* mobile phone
* home phone
* civil status
* studies
* prof_exp
* psycho_eval
* qualification
* availability
Structural Rules: Employees. Salaries.
Shifts

• Each EMPLOYEE must have one or more SALARY


entries. Each SALARY has a date time attribute (as part
of the unique identifier) and a value. The SALARY entity
models historical data.
• Each EMPLOYEE must work in one or more SHIFTs in
time. Each SHIFT has a date time attribute (as part of
the unique identifier) and the number of hours for that
shift.
ERD: Employees. Salaries.
Shifts

EMPLOYEE
# id
* first name
* last name
* address
(#1) contract no
(#2) ID card no
* birth date
* mobile phone SALARY
have
* home phone # date time
* civil status for * salary
* studies
* prof_exp
* psycho_eval SHIFT
work in
* qualification # date time
* availability for * number of hours
Structural Rules: Orders. Services.
Products

• ORDERs make the use of SERVICEs.


• For each SERVICE we keep track of a name, the price
per unit and optionally a range start, a range end and a
description. It also has an artificial id assigned.
• Some SERVICEs require the use of PRODUCTs.
(e.g. A4 Print requires A4 Paper)
• For each PRODUCT we keep track of the name and
price per unit. It is also assigned an artificial id.
ERD: Orders. Services.
Products

required by
PRODUCT SERVICE
# id require # id
* name * name
* price per unit ° range start
° range end
* price per unit
° description

on
ORDER
# date time list
* copies have SERVICES LIST
* count
REGULAR
of

TYPOGRAPHY
Structural Rules: Locations. Products.
Suppliers

• For each LOCATION we store its shorthand name (as


the unique identifier) and the address. Each
LOCATIONs must either be a COPY CENTER or a
STOREHOUSE.
• The STOCK entity is a joint between LOCATIONs and
PRODUCTs, used to refer to PRODUCTs at different
LOCATIONs.
• The TRANSFER entity has a date time attribute (as part
of the unique identifier) and a quantity value. Each
TRANSFER is assigned to a STOCK to determine
incoming and outgoing (or sold) stock.
ERD: Locations. Products.
Suppliers

PRODUCT
# id
LOCATION * name
# name * price per unit SUPPLIER
* address # id
* name
STOREHOUSE
listed on the provider of

COPY CENTER
for provided by

STOCK TRANSFER
have have
# date time
of of * quantity
° price
Structural Rules: Employees. Locations.
Transfers

• Each EMPLOYEE may be responsible for one


LOCATION. Each EMPLOYEE must work in one and
only one LOCATION.
• An EMPLOYEE may order one or more TRANSFERs.

EMPLOYEE
LOCATION # id
# name * first name TRANSFER
* address * last name order
# date time
* address * quantity
STOREHOUSE (#1) contract no ordered by
° price
(#2) ID card no
* birth date
* mobile phone
COPY CENTER supervised by * home phone
* civil status
responsible for * studies
assigned * prof_exp
* psycho_eval
work in * qualification
* availability
Structural Rules: Location.
Equipment

• For each EQUIPMENT we assign an artificial identifier.


EQUIPMENTs must be either COMPUTERs or
PRINTERs. We don't keep track of any other kind of
equipment. For each COMPUTER we keep track of the
processor, monitor, RAM, HDD, CD-R, CD-RW, DVD-
RW. For each PRINTER we only need to know its type
and an optional description.
• Each PRINTER must have one or more COMPONENTs.
For each COMPONENT we keep track of its name and
we assign an artificial id. COMPONENTs may be
changed in time. When a COMPONENT CHANGE
occurs we keep track of the date time (as partial unique
identifier) and the value of printer's counter value.
Structural Rules: Location.
Equipment

• EQUIPMENTs may be moved from one LOCATION to


another. We keep track of where it's been over time. The
EQUIPMENT LIST entity handles positioning of
EQUIPMENTs at different LOCATIONs in time.
ERD: Location. Equipment

LOCATION
# name
* address

STOREHOUSE

EQUIPMENT
# id
COPY CENTER
COMPUTER
* processor
* monitor
* RAM
* HDD
° CD-R
° CD-RW on
° DVD-RW
list

PRINTER EQUIPMENT
on
* type LIST
° description list # date time

have

inside

COMPONENT COMPONENT
have
# id CHANGE
* name occur to # date time
* value
Procedural Rules

• EMPLOYEEs may practice their skills by working,


improving their qualification.
• An EMPLOYEE`s SALARY is negotiated with the
manager whenever changed. EMPLOYEEs have fixed
salaries.
• The schedule for each week is made in advance and the
database is populated with EMPLOYEEs shifts.
• When EMPLOYEEs order a transfer they should
have an approval.
• Every evening sold stock is quantified and the database
is populated with this data.
• Stock may be transferred either from a supplier to the
storehouse or from a storehouse to a copy center.
Programmatic
Rules

• EMPLOYEE`s current salary is the latest SALARY entry


(as of the date time attribute).
• SHIFTs are deleted when they are four weeks overdue.
• The total price of a SERVICE is the price of the
PRODUCT it requires plus its own price.
• The total price of an ORDER is the sum of all SERVICEs
it requests multiplied by the number of copies.
• A REGULAR ORDER is always complete on the next
day after it was placed.
• A TYPOGRAPHY ORDER is complete when the sum of
quantities in all associated PARTs of ORDER equals the
copies no attribute.
Programmatic
Rules

• The current LOCATION of one EQUIPMENT is


determined using the most recent of its EQUIPMENT
LIST instances.
• The current available stock of one PRODUCT at one
LOCATION is determined by summing all TRANSFER
quantity values of the STOCK instance for that
PRODUCT and LOCATION.
• When the PRINTER is firstly added in the database the
values of its components` counters are also added in the
database.
Explanations

• Attribute prof_exp for EMPLOYEE is a text describing


his/her professional experience.
• Attribute psycho_eval for the same entity is a text
describing the result of the psychological evaluation.
• Qualification attribute for EMPLOYEE is either 1, 2, 3.
0 means he ca only make copies, 1 he can also print,
2 he is qualified to use all equipment at the copy center.
• Attribute availability is a number between 1 and 3
describing how available is an EMPLOYEE for being
called when there is an emergency.
• REGULAR ORDERs don’t need a due date as their
due date is by default the next day.
Explanations

• Attribute copies no for ORDER says how many copies of


the entire order (list of services) should be done. (e.g.
When you copy a book you might want two copies of it.)
Attributes description for both PRINTER and SERVICE
is a text with additional explanations.
• The quantity attribute of TRANSFER is positive when
counting incoming stock and negative when counting
outgoing or sold stock.
• The price for TRANSFER is the price per unit.
• Attributes range start and range end are used for the
kind of services that are differentiated by range and cost.
The cost can’t be calculated programmatically by range.
(e.g. A4Print 1-29 is 1000 lei, while 30-149 is 550 lei.)
Assumptions.
Constraints

ASSUMPTION
• Now there is only one STOREHOUSE to keep track of.
We assume that in the future there may be more than
one STOREHOUSE.
CONSTRAINTS
• TRANSFERs in relationship with a SUPPLIER must
have the price attribute filled and must be in relationship
with one STOREHOUSE (through a STOCK instance).
• TRANSFERs not in relationship with a SUPLLIER
must not have the price filled and must be in relationship
with one COPY CENTER (through a STOCK instance).
Constraint
s

• Sum of all quantity attributes from PART OF ORDER


has to be lower than or equal to the copies no attribute
of their respective TYPOGRAPHY ORDER.
• We don’t need time constraints, as we only keep track of
the date and time changes occurred.
ER PRODUCT
required by
SERVICE

D
# id require # id
* name * name
* price per unit SUPPLIER CLIENT ° range start
# id # ID card no ° range end
* name * first name * price per unit
* last name ° description
listed on the provider of place

LOCATION for provided by


# name have have
STOCK TRANSFER placed by
* address
on
of of # date time
STOREHOUSE ORDER
* quantity list
# date time
by ° price
EQUIPMENT * copies no have SERVICES LIST
# id * count
order REGULAR
of
COPY CENTER supervised by receive
COMPUTER EMPLOYEE
* processor responsible for # id received by
* monitor * first name handle PART OF
* RAM assigned * last name TYPOGRAPHY assigned
ORDER
* HDD * address handled by # date time
work in of
° CD-R (#1) contract no * quantity
° CD-RW on (#2) ID card no
° DVD-RW * birth date
list * mobile phone SALARY
have
* home phone # date time
PRINTER EQUIPMENT
on * civil status for * salary
* type LIST
° description # date time * studies
list * prof_exp
* psycho_eval SHIFT
work in
have * qualification # date time
* availability for * number of hours
inside

COMPONENT COMPONENT
have
# id CHANGE
* name occur to # date time
* value
Sample Mapping
EMPLOYEE (EPE) LOCATION (LCN)
key type optionality column name key type optionality column name
pk * id pk * name
* fname * address
* lname * LCN_type
* address fk, uk ° EPE_id
uk * contract_no
uk * IDcard_no PRODUCT (PDT)
* birthdate key type optionality column name
* mobilephone pk * id
* homephone * name
* civilstatus * price_per_unit
* studies
* profexp SERVICE (SVE)
* psychoeval key type optionality column name
* qualification pk * id
* availability * name
fk * LCN_name * priceperunit
° rngstart
° rngend
° description
fk ° PDT_id
Sample
Data
EMPLOYEE
id fname lname qualification availability LCN_name
3 Laura Jianu 1 2 HABITAT
5 Alexandru Codreanu 1 1 HABITAT
17 Ciprian Moraru 2 3 COPOU
62 Petru Olariu 3 2 COPOU
72 Irina Pintilie 1 1 HABITAT

LOCATION
id name address LCN_type EPE_id
0 STOREHOUSE b-dul Socola, nr. 13 storehouse NULL
1 COPOU sos Stefan cel Mare si Sfant, nr. 11 copy center 62
2 HABITAT b-dul Carol I, nr.4 copy center 5
3 INDEPENDENTEI b-dul Independentei, nr. 1 copy center 13
4 TUDOR str Ciurchi, nr. 80 copy center 21

PRODUCT SERVICE
id name price_per_unit id name rngstart rngend price_per_unit description PDT_id
13 A4 White Paper 250 3 A4 Printing (one side) 1 29 750 13
16 A4 Cardboard 3,000 4 A4 Printing (one side) 30 1499 300 13
19 A3 White Paper 500 19 Photo Editing (/minute) NULL NULL 10,000 NULL
25 CD 20,000 21 Binding NULL NULL 5,000 37
26 CD-RW 50,000 23 A4 T-Shirt Printing NULL NULL 100,000 49

The dotted lines skip attributes we did not consider very important.
Report: Schedule

Irina Pintilie
Schedule for the current week

NOV 15 NOV 16 NOV 17 NOV 18 NOV 19 NOV 20 NOV 21


MON TUE WED THU FRI SAT SUN
8:00

12:00

16:00

20:00

0:00

4:00

The user needs to select an employee and the week to view (current or one of the past four).
Report:
Salaries

Salaries
September 1st – November 1st
Employees with qualification greater than 1.

SEP 1 SEP 15 OCT 1 OCT 15 NOV 1


Ciprian Moraru 5,560,000 5,560,000 5,560,000 5,560,000 5,560,000
Petru Olariu 4,300,000 4,300,000 4,300,000 5,560,000 5,560,000

The user needs to select the employees and time range.


Report:
Transfers

Transfers
September 1st – November 1st
Location: HABITAT Product: A4 White Paper

Quantity
WED Nov 10, 2004 9 packs ordered
WED Nov 10, 2004 11 packs consumed
THU Nov 11, 2004 11 packs ordered
THU Nov 11, 2004 8 packs consumed
FRI Nov 12, 2004 14 packs ordered
FRI Nov 12, 2004 16 packs consumed
SAT Nov 13, 2004 16 packs ordered
SAT Nov 13, 2004 7 packs consumed
SUN Nov 14, 2004 3 packs ordered
SUN Nov 14, 2004 4 packs consumed
MON Nov 15, 2004 8 packs ordered
MON Nov 15, 2004 15 packs consumed

The user needs to select the location, the product and the time range.
The database stores quantity as pages and a pack of paper has 500 pages. We store the time
with data, but it’s not shown here, as we only show the totals for “ordered” and “consumed”.
Report:
Transfers

Transfers
September 1st – November 1st
Consumptions as chart.
Location: HABITAT Product: A4 White Paper

18

16

14

12

10

The user needs to select the location, the product and the time range.
Report:
Orders

Orders
Active orders.

Date Client ID card Client name Copies


TUE 16 Nov, 2004 MX 758461 Elena Safta 1 
Service Media (product) Count Total price per unit
A4 Print (30-149) A4 White Paper 132 550
Binding Arc 16 mm 1 12,000

TUE 16 Nov, 2004 MX 347667 Iuliana Apostol 3 


TUE 16 Nov, 2004 MX 156916 Silvian Melinte 1 
PIM Copy Center
Even with an efficient database model ready,
good databases must be brought to life by good

front-end applications.

Thank you for following us through our presentation.


The bond between successful business and
efficient databases is behind a door.
Be sure to knock at us!
www.liis.ro/~spider/live/nefladabee

Iolanda Popa (Ioli) Ioana Comănici (Joanne)

Motto: “The greatest trick the devil ever


Motto: “Trying to turn the lights on.”
pulled was convincing the world
he didn't exist.”
(The Usual Suspects)

Alexandru Mihai Bîrsan (Alex) Dan Andrei Diac (Dan)

Motto: “Happiness comes of the Motto: “Our greatest glory consists not
capacity to feel deeply, to enjoy in never falling, but in rising
simply, to think freely, to risk life every time we fall.”
and be needed.” (Confucius)
(Storm Jamison)

Liceul de Informatică “Grigore C. Moisil”, Iasi, România

You might also like