0% found this document useful (0 votes)
3 views26 pages

Database Design

PC Online Shop

Uploaded by

saiyannsic20
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views26 pages

Database Design

PC Online Shop

Uploaded by

saiyannsic20
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

សាកលវទ្យាល័ យភូ មិន្ទភនំពេញ


Royal University Of Phnom Penh

GROUP 6
• LEAP PHANIPHA
• YON SREYPIN
• YONG SREYOUN
• YOEURTH SAIYANN
1 FLOW OF OURS PROJECT

2 STRONG ENTITY SET

3 WEAK ENTITY SET

Table of 4 RELATIONSHIP EACH TABLES


Contents
ENTITY RELATIONSHIP DIAGRAM &
5 TABLES

6 NORMALIZATION

7 DEMO PROJECT WITH INTERFACE


FLOW OF OURS PROJECT
ADMIN CUSTOMER

MANAGE && CHECK CREATE


1
INFORMATION 4
ACCOUNT AND
LOGIN

IMPORT AND VIEW AND ADD


UPDATE PRODUCTS CART
2 5

ORDER
REPORT
3 6
PRODUCT
❑ ក្នុងប្រព័ន្ធប្ររ់ប្រងក្ុុំពយូទ័ររ ន្ង
ិ គរហទុំពរ័ គ ង
ើ អាចក្ុំណត់បាន្ Entities មួ ចុំន្ួន្ដូចជា:

❖ ចុំគ ោះមន្ុស្ស:
1.ពត៌មាន្ររស្់អតថ ិ ជ
ិ ន្(Customers's Information)
2.ពត៌មាន្ររស្់អនក្ប្ររ់ប្រងប្រព័ន្ធ( Admin's Information)
3.ពត៌មាន្អនក្ផ្គតផ្
់ ងគ (់ Vender's Information)

❖ ចុំគ ោះវតថុ:
1.ពត៌មាន្ររស្់ក្ុុំពយូទ័រ( Product's Information)
2.ពត៌មាន្ររស្់ប្រគេទក្ុព ុំ យូទ័រ( Category's Information)

❖ ចុំគ ោះប្ពត
ឹ កា
តិ រណ៍:

1.ពត៌មាន្នន្ការនន្ការនុំចូល (Import’s information)


2.ពត៌មាន្នន្ការក្មមង ៉ ទ់ ន្
ុំ ញ
ិ ( Order's information)
3.ពត៌មាន្នន្ការអតថ ិ ជិ ន្ដាក្់ទន្
ុំ ញ
ិ ចូលក្ន្តន្តក្( Cart's information)
4.ពត៌មាន្នន្វធ
ិ រ
ី ង់ប្បាក្់( Payment's Information)
Strong Entity Sets
Weak Entity Sets
REALATIONSHIP EACH TABLE
1 M
One-To-Many

1 M
One-To-Many

M
1 One-To-Many

1 1
One-To-One
REALATIONSHIP EACH TABLE

1 M
One-To-Many

1 1
One-To-One

1 M
One-To-Many
REALATIONSHIP EACH TABLE
M N

a. IMPORT មួ ដងអាចមាន្ PRODUCT​ គប្ចន្ ើ


b. PRODUCT​ ន្ម ី ួ ៗប្តូវបាន្ IMPORT មួ ឬ គប្ចន្
ើ ដង
ដូចគន្ោះគ ង
ើ ប្តូវរម្មែងគៅជាទប្មង់ ONE-TO-MANY:

1 M N 1
REALATIONSHIP EACH TABLE
M N

a. មាន្័ ថា ORDER មតងអាចមាន្ PRODUCT មួ មុខ ឬ គប្ចន្ ើ មុខ


b. មាន្័ ថា PRODUCT​ ន្ម ី ួ ៗអាចប្តូវបាន្ ORDERមួ ដង ឬ គប្ចន្
ើ ដង
ដូចគន្ោះគ ង
ើ ប្តូវរម្មែងគៅជាទប្មង់ ONE TO MANY:

1 M N 1
ENTITY
RELATIONSHIP

DIAGRAM
-ADMIN TABLE:

❖ Primary Key: id
-CUSTOMER TABLE:

❖ Primary Key: customer_id


-CATEGORY TABLE:

❖ Primary Key: category_id


-ORDER TABLE:

❖ Primary Key: order_id


❖ Foreign Key: customer_id & payment_method_id
-ORDER DETAILS TABLE TABLE:

❖ Primary Key: (order_id (FK) + product_id(FK) )


-PRODUCT TABLE:

❖ Primary Key: product_id


❖ Foreign Key: category_id
-IMPORT TABLE:

❖ Primary Key: id
❖ Foreign Key: venderId
-IMPORT DETAILS TABLE:

❖ Primary Key: (order_id (FK) + product_id(FK) )


-CART TABLE:

❖ Primary Key: cart_id


❖ Foreign Key: customer_id & product_id
-VENDER TABLE:

❖ Primary Key: id
-PAYMENT METHOD TABLE:

❖ Primary Key: payment_method_id


NORMALISATION (2NF)
Products ➢ In the given table, we can see that there are two
functional dependencies:
product_id
1.product_id -> category_id
2.category_id -> category_name
category_id

➢ The first functional dependency indicates that the category_id is


determined by the product_id. This means that for each product, there
productName
is only one category that it belongs to. The second functional
dependency indicates that the category_name is determined by the
CategoryName category_id. This means that for each category, there is only one name.

price

➢ Based on these functional dependencies, we can create


two separate tables: one for product and one for category.
qty

description
NORMALISATION (2NF)
The Products table will contain all the
information related to products, including the
product_id, category_id, product_name, qty,
description image, and price. The primary key of
this table will be the product_id, and the
category_id will be a foreign key referencing the
Category table.
The Category table will contain all the
information related to category, including the
category_id name. The primary key of this table
will be the category_id.
ALL TABLE

You might also like