Sie sind auf Seite 1von 12

University "St.

Cyril and Methodius" - Skopje


Faculty of Economics

Technology devices
Department E - Business

selling company PC-NET


database
Fundamentals of Internet Architecture

Mentors: Made by:

Prof. D-r. Sasho Josimovski Katja Popovska 54478


Assistant Martin Kiselichki Marija Sterjovska 54485
Ivana Slavevska 54494
Natasha Razmoska 55118
Simona Nedelkovska 55132

Skopje, 2014
Contents

1. Database for technology devices selling company ........................................................................... 2


2. Processes in the company. ................................................................................................................ 2
3. Objectives.......................................................................................................................................... 2
4. Business rules .................................................................................................................................... 3
5. Normalization .................................................................................................................................... 4
5.1 ER .................................................................................................................................................... 4
5.2 Main Tables ..................................................................................................................................... 4
5.3 1NF .................................................................................................................................................. 5
5.4 2NF .................................................................................................................................................. 6
5.5 3NF .................................................................................................................................................. 7
5.6 List of the attributes for each entity and M-N relationship ............................................................ 8
5.7 Final set of tables ............................................................................................................................ 9
5.8 Referential Integrity ...................................................................................................................... 10
6. CONCLUSION ................................................................................................................................... 11

1|Page
1. Database for technology devices selling company
The aim of this project is to improve the data storage and retrieval of information for
an imaginary selling institution for technology devices such as laptops and tablets that we
named “PC-NET”. For the purposes of this institution we will design a database that will
integrate all the needed information, which will eliminate data redundancy and all other
data management problems. The motive for creating this kind of database is to provide a
better way for storing information about which products are available in which stores
regarding the fact that this database is used for one company that has stores in different
cities.

The solution that we offer with this database created in Microsoft Access will enable
the users with user-friendly and easier access to the needed information by asking simple
queries to the database.

2. Processes in the company


This company represents retailer stores that offer high-quality technology devices
such as laptops and tablets. The database is not a necessity for this kind of companies
however it is recommended to have one regarding the fact that there is a need of storing
information about the selling process such as who is the customer, what product is he
buying or who is the seller. The process first of all consist of entering info about the
customer who is buying the product, than what product is he buying. This is followed by
creating invoice that consist info about the date of the purchase and the total prize. After
the invoice is entered in the database the information about the seller of the product is
entered next. Finally when a product is bought by someone, it is removed from the list of
the available products in the database.

3. Objectives
Nowadays having reliable information available in any time is of a great importance
for every company. In this case precisely for the previously mentioned company “PC-NET”
having a good connection and flow of the information is very important. According to this
we can say that this database will improve the flow of information and the business
processes such as efficient and easy access to the information about which products are
available at the moment and in which stores.

2|Page
4. Business rules
According to the previous information our database must follow the following
business rules:

1. One customer can buy many products, and one product can be bought by many
customers.
 According to the previously mentioned rule there is a many-to-many
relationship between the customers and the products, as a result of this
there are two junction tables: invoice and line item.
2. One product can be included in only one invoice, but one invoice can include many
products.
3. One invoice can have many line items, but one line item can be part of only one
invoice.
4. One product can be part of only one line item, but one line item can have many
products.
5. One product can have only one category, but one category can have many products.
6. One product can have only one brand, but one brand can have many products.
7. One shop can have many products, and one product can be sold in many stores.
 According to the previously mentioned rules there is a many-to-many
relationship between the products and the shops, as a result of this there is a
junction table between them, shop info.
8. One employee can sell many products, and one product can be sold by many
employees.
 According to the previously mentioned rules there is a many-to-many
relationship between the employees and the product, as a result of this
there is a junction table, realised sales.
9. One employee can have only one job title, but one job title can be given to many
employees.

3|Page
5. Normalization
5.1. ER – Diagram

5.2. Main Tables

Customers Products
Name Name
Address Category
Contact Brand
Price
Manufacturer
Shop Name
Shop address
Employee Name
Employee
contact
Job title
Job description
Salary

4|Page
5.3. First Normal Form

 Step One: Each filed must be atomic.

Customers Products
First Name Product Name
Last Name Category Name
Street Name Brand Name
House Number Manufacturer
City Price
Phone Number Shop Name
E-mail Shop Street Name
Shop Street Number
Shop City
Employee First Name
Employee Last Name
E. Phone Number
E. E-mail
Job Name
Job Description
Job Salary

 Step two: Multi-valued data must be moved to another table.

 Step three: Repeating groups must me moved to another table.

Customers Products Categories Brands


First Name Product Name Category Name Brand Name
Last Name Price Manufacturer
Street Name Shop Name
House Number Shop Street Name
City Shop Street Number
Phone Number Shop City
E-mail Employee First Name
Employee Last Name
E. Phone Number
E. E-mail
Job Name
Job Description
Job Salary

5|Page
 Step four: Each 1 NF – complaint table must have a primary key.

Customers Products Categories Brands


Customer ID Product ID Category ID Brand ID
First Name Product Name Category Name Brand Name
Last Name Price Manufacturer
Street Name Shop Name
House Number Shop Street Name
City Shop Street Number
Phone Number Shop City
E-mail Employee First Name
Employee Last Name
E. Phone Number
E. E-mail
Job Name
Job Description
Job Salary

5.4. Second normal form

 All tables must be normalized to 1 NF.

 Any value that doesn`t support the entity represented by the primary key must be
moved to another table.

Customers Products Categories Brands Shops Employees


Customer ID Product ID Category ID Brand ID Shop Name First Name
First Name Product Name Category Name Brand Name Shop Stret Name Last Name
Last Name Price Manufacturer Shop Street Number Phone Number
Street Name Shop City E-mail
House Number Job Name
City Job Description
Phone Number Job Salary
E-mail

6|Page
 Each 2NF-complaint table must have a primary key.

Customers Products Categories Brands Shops Employees


Customer ID Product ID Category ID Brand ID Shop ID EMBG
First Name Product Name Category Name Brand Name Shop Name First Name
Last Name Price Manufacturer Shop Stret Name Last Name
Street Name Shop Street Number Phone Number
House Number Shop City E-mail
City Job Name
Phone Number Job Description
E-mail Job Salary

5.5. Third Normal Form

 The table should conform to 1 NF and 2N.

 All field that are mutually depended must be moved to another table

Customers Products Categories Brands Shops Employees Job Title


Customer ID Product ID Category ID Brand ID Shop ID EMBG Job Name
Category Job
First Name Product Name Name Brand Name Shop Name First Name Description
Last Name Price Manufacturer Shop Stret Name Last Name Salary
Shop Street
Street Name Number Phone Number
House Number Shop City E-mail
City
Phone Number
E-mail

 Each 3 NF – complaint table must have a primary key

7|Page
5.6. List of the attributes for each entity and M:N relationships

Relationship
Table Field Datatype Foreign Key Field
Type
CustomerID AutoNumber
FirstName Text
LastName Text
StreetName Text
Customers
HouseNumber Number
City Text
PhoneNumber Text
E-mail Text
InvoiceNumber Number One-to-Many Customers.CustomerID
InvoiceDate Date/Time
Invoice
Total Currency
CustomerID(FK) Number
LineNumber AutoNumber One-to-Many Invoice.InvoiceNumber
Quantity Number One-to-Many Products.ProductID
UnitPrice Currency
LineItem InvoiceNumber (FK) Number
Total Currency
ProductID (FK) Number
ProductID Number One-to-Many Categories.CategoryID
ProductName Text One-to-Many Brands.BrandID
Price Currency
Products
CategoryID (FK) Number
BrandID (FK) Number
EmployeeInfoID AutoNumber One-to-Many Products.ProductID
EMBG (FK) Text
RealisedSales
ProductID (FK) Number

EMBG Text One-to-Many JobTitle.JobID


FirstName Text
LastName Text
Employees
PhoneNumber Text
E-mail Text
JobID (FK) Text
JobID Text
JobDescription Text
JobTitle
Salary Currency

ShopInfoID AutoNumber One-to-Many Products.ProductID


AvailableQuantity Number One-to-Many Shops.ShopID
ShopInfo
ProductID (FK) Number
ShopID (FK) Number

8|Page
ShopID AutoNumber
ShopName Text
Shops ShopStreetName Text
ShopStreetNumber Number
ShopCity Text
CategoryID AutoNumber
Categories CategoryName Text
BrandID AutoNumber
Brands BrandName Text
Manufacturer Text

This database includes three Many-to-Many relationships, they are the following: the
relationships between Customers and Product, Products and Shops and Products and
Employees. But considering that Access doesn’t support Many-to-Many relationships, the
creation of junction tables is necessary. In order to link the Customers and Products entity,
the M-N relationship between them needs to be broken down into One-to-Many
relationships. To achieve that we created two new junction tables Invoice and LineItem.
Same goes for the other two M-N relationships. For linking the Products and Shops entity
we created ShopInfo and for linking the Procucts and Employees entity we created
RealisedSales.

5.7. Final Set Of Tables

 Customers ( CustomerID, FirstName, LastName, StreetName, HouseNumber, City,


PhoneNumber, E-mail)
 Invoice ( InvoiceNumber, InvoiceData, Total, CustomerID (FK) )
 LineItem(LineNumber, Quantity, UnitPrice, Total, InvoiceNumber(FK), ProductID(FK))
 Products (ProductID, ProductName, Price, CategoryID (FK), BrandID (FK) )
 RealisedSales (EmployeeInfoID, EMBG (FK), ProducrID (FK) )
 Employees ( EMBG, FirstName, LastName, PhoneNumber, E-mail, JobTitle (FK) )
 JobTitle (JobID, JobDescription, Salary )
 ShopInfo (ShopInfoID, AvailableQuantity, ProductID (FK), ShopID (FK) )
 Shops (ShopID, ShopName, ShopStreetName, ShopStreenNUmber, ShopCity )
 Categories (CategoryID, CategoryName )
 Brands (BrandID, BrandName, Manufacturer )

9|Page
5.8. Referential Integrity

Referential Integrity
Relationships Cascading behavior
constraints
On
Parent Child On update
delete
CustemerID in Invoice
Customers Invoice must exist CustomerID No No
in Customers
InvoiceNumber in
LineItem must exist
Invoice LineItem No No
InvoiceNumber in
Invoice
ProductID in LineItem
Products LineItem muse exist ProductID in No No
Products
ProductID in
RealisedSales musr
Products RealisedSales No No
exist ProductID in
Products
EMBG in RealisedSales
Employees RealisedSales must exist EMBG in No No
Employees
JobID in Employees
JobTitle Employees must exist iJobID in No No
JobTitle
CategoryID in Products
Categories Products must exist CategoryID No No
in Categories
BrandID in Products
Brands Products must exist BrandID in No No
Brands
ShopID in ShopInfo
Shops ShopInfo must exist ShopID in No No
Shops
ProductID in ShopInfo
Products ShopInfo must exist ProductID in No No
Products

10 | P a g e
6. Conclusion
This database provides access to the company’s products and information regarding the
clients. Besides the fact that it improves classification of data, it will also simplify the process
of making a purchase. It will give them a better and faster view of client’s information. We
strongly believe that this database will be beneficial for the company, since they haven’t
developed this kind of data collection.

11 | P a g e

Das könnte Ihnen auch gefallen