Project Report

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

VIETNAM NATIONAL UNIVERSITY, HANOI

INTERNATIONAL SCHOOL
----oOo----

INS2055 – DATABASE SYSTEMS

PROJECT REPORT
DATABASE OF PRODUCT FLOW IN A FASHION SHOP

Group information
Phạm Thanh Trường – 20070012
Trần Thị Thu Hà - 20070922
Lecturer
Trần Thị Oanh

Hanoi - 2021
MEMBERS’ CONTRIBUTION
Phạm Thanh Trường:
+ Case research
+ Gather real information for the database
+ Design ERD
+ Write ERD report
+ Prepared chapter 1 of the report
+ Idealize the relational schema
+ Build physical database base on relational schema and real data, including
writing the sql script and insert some data
+ Design some useful reports and information for real usage
+ Conclude the project
Trần Thị Thu Hà:
+ Case research
+ Gather information for the database
+ Convert ERD into relational schema
+ Report about the schema
+ Insert real data into the sql script
+ Give out solutions for the useful reports and information for real usage
+ Proofread and edit the report

2
Table of Notations and Abbreviations

Abbreviation Meaning
ERD Entity Relationship Diagram
FK Foreign Key
PK Primary Key

3
List of Tables

4
CONTENTS

Chapter 1: INTRODUCTION 6
1. About the Organization 6
2. Requirement Specification 6
2.1. Methods for investigating business rules: 6
i. Interview 6
ii. Reading news/websites 7
iii. Observation 7
3. Business Narrative 8
Chapter 2: ANALYZING AND DESIGNING THE DATABASE 8
1. ERD 8
2. Relational Schema 8
3. Some real data and SQL scripts 10
Chapter 3: SOME USEFUL REPORTS AND INFORMATION 11
1. Design some useful reports and information for real usage 11
2. Solutions for the above reports/information 11
Chapter 4: CONCLUSION 13

5
Chapter 1: INTRODUCTION

1. About the Organization


Truong Ha fashion shop was first introduced and open for business 2 years ago, most
of the store’s products include clothing and sometimes jewelry, but the jewelry
business of the shop was not a success so there will be no data whatsoever included in
the system. The operation of the store is rather simple, the manager buys items from a
trustworthy wholesale partner in China and then puts a tracking and authenticatication
tag for after service and to prove that item is a high quality item from our store
afterward, the items will be sold to the customer in Vietnam’s region. The business also
includes collaboration with a certain shipping company.
2. Requirement Specification
2.1. Methods for investigating business rules:
It was not hard to figure out the database system of the shop since the owner was a
very good friend of mine and our team had 3 types of investigation made to clarify the
data which afterward used by us to build up parts of this final examination.
i. Interview
We spent 2 hours everyday for a whole week to interview the owner of the
shop, we asked about where the source of her products was, how was that
product made, if it was good to use and if it was from trustworthy and high
quality facturers and suppliers.
ii. Researching the websites
After investigating all about the origin and how the items were made, me
conducted a research on the shop’s facebook page ad website to find out the
way they handle their business with customer, or to be exact, how did they
sell their items and if the customer come to the shop directly to buy the
items or they buy them online and have them delivered to their house.
We found out that the shop is now working only on online platforms since
the pandemic brought up a very big safety issue, they decided to close the
physical shop until the working environment is safer, this is when we

6
inspect their shipping collaboration more carefully and put it in our
database.
iii. Observation
After looking at the store’s online platforms and its shipping companions,
we wanted to inspect further in the flow of the items, would there be any
other trading activities of goods after it was bought used by the customer or
not. In this investigation, we found out the shop supported its clients to buy
and trade theirs good after buying it by establishing a trading and reselling
the store’s goods community a website and there is no shipping
collaboration seen in this part, the customer can offer and deal and trade
freely with the website playing the role of a midman to verify the
authenticity of the product.

3. Business Narrative

The first part that we consider the root of this business is the MANUFACTURER and
the SUPPLIERS of the shop, with out these two factors, the shop would not be able to
operate, the MANUFACTURER has its name and address to prove that this is a good
and verified source of item, then the MANUFACTURER contact with its wholesale
partner who will resell to the retail shop – the SUPPLIERS and each supplier will have
its own number symbolize for the priority to buy better goods, which SUPPLIER have
lower number in the MANUFACTURER’s list will have the better chance to buy good
items. Many SUPPLIERS provide many ITEMS which have authenticity code and
proof of origin. And through the SHOP, the ITEMS will be DELIVERED to
CUSTOMERS by SHIPPERS who are bound to the SHIPPING COMPANY.
Afterwards, the CUSTOMERS can through the trading platform, trade the goods to
2NDCUSTOMERS.

7
Chapter 2: ANALYZING AND DESIGNING THE DATABASE

1. ERD
To draw an erd, we must first find out all the strong entities and theirs attributes,
firstly the strong entities can be observed are MANUFACTURER have attribute
name and address, SUPPLIERS have attribute number and phone number,
ITEMS have attribute code and origin, SHIPPING COMPANY have attribute
shipping code and delivery code, CUSTOMERS have attribute name, address and
phone number and finally 2ND CUSTOMERS have attribute name, address and
phone number. For the part of relationships between them, MANUFACTURER to
SUPPLIERS will be one must to maybe many since there must be manufacturer
as the source and that source may sell to many suppliers and for the rest of the
strong entities, the relationships between them all are many maybe to many
maybe since many suppliers provide many items and those items may be shipped
to many customers by many shipping company such as GHTK or Be or Extra
Shipping and so on and many customers can also trade to many second
customers.
After expanding the erd, we can see some more weak entities added in between
all the many to many relationships first we have the SHOP weak entities after the
expansion of suppliers and items many to many relationship since supplier have
to go through shop and the shop will sell items, the shop entity have attribute is
its name. Followed by the expansion of shipping company and items many to
many relationship is the appearance of the weak entity DELIVER since items
must be delivered to the shipping company in order to be shipped to the
customers, this leads to the appearance of weak entity SHIPPER when expanding
many to many relationship of shipping company and customers.
2. Relational Schema
Firstly, we will list, select the filter information that must be given.
Next, we define the files and relationships between the implementation
collectives.
For example, in my ERD, we have:
One MANUFACTURER can have a lot of SUPPLIERS

8
From SUPPLIERS we can add more unimportant entity is weak entity - SHOP
One SUPPLIERS and One ITEMS can have a lot of SHOP
From ITEMS we can add more unimportant entities that are weak entities -
DELIVER
One ITEMS may have a lot of DELIVER
One SHIPPER may have a lot of DELIVER
From SHIPPER we can add more unimportant entity is weak entity - SHIPPING
COMPANY
One SHIPPER may have a lot of SHIPPING COMPANY
One CUSTOMER may have a lot of SHIPPING COMPANY
From CUSTOMER we can add more unimportant entity is weak entity -
RESELLER
One CUSTOMER may have a lot of TRADING
2NDCUSTOMER may have a lot of TRADING
The next step is to define attributes like primary key, foreign key… and bind the
attribute for the file and relationship.
For example, in my ERD, we have:
- Primary key:

Primary Key (Manufacturer_Name)

Primary Key (Supplier_Number)

Primary Key (Item_Code)

Primary Key (Shipping_Code)

Primary Key (Customer_Name)

Primary Key (Second_Customer_Name)

- Forgein key:

Foreign Key (Manufacturer_Name) references SUPPLIERS

Foreign Key (Item_Code) references ITEMS

9
Foreign Key (Supplier_Number) references SUPPLIERS

Foreign Key (Shipping_Code) references SHIPPING_COMPANY

Foreign Key (Customer_Name) references CUSTOMER

Foreign Key (Second_Customer_Name) references SECOND_CUSTOMER

Finally, draw an ERD diagram that identifies the type associations of the jobs
performed in the schema.

3. Some real data and SQL scripts

10
Chapter 3: SOME USEFUL REPORTS AND INFORMATION
Design some useful reports and information for real usage
Show item list and quantity of each item

Find out the authenticity code and origin of time

sort out the items by alphabet

Show information of customers

delete some customers information

delete some items information

find out which shipper delivered item

find out which supplier provided what item

Count the number of shippers of each company

Show information of 2nd customer

Solutions for the above reports/information

#1

SELECT Item_Name, COUNT(Item_Name) AS "So luong"

FROM ITEMS

GROUP BY Item_Name;

#2

select Item_Code, Origin from items;

#3

select * from items order by item_name;

11
#4

select customer_name, customer_phone_number from customer;

#5

delete from customer where customer_name like '%anh%';

#6

delete from item where item_code > 10;

#7

select s.shipper_code, d.item_code from shipper s inner join deliver d

on s.shipping_code = d.shipping_code;

#8

select s.supplier_name, i.item_name from suppliers s

inner join shop s1

on s.supplier_number = s1.supplier_number

inner join items i

on s1.item_code = i.item_code;

#9

select s.shipping_code, count(*) from shipper s inner join


shipping_company c

on s.shipping_code = c.shipping_code

group by s.shipping_code;

#10

select Second_Customer_Name, Second_Customer_Address,


Second_Customer_Phone_Number from SECOND_CUSTOMER ;

12
Chapter 4: CONCLUSION

To conclude the project, I hereby summarize some of the plus points and also the
downsides of the database built by our group as follows:
1. Advantages of the project to the business:
+ The database provides the business a clearer view of what they are doing
and how many partners they are working with
+ The database provides a much more scientific way of managing the
amount of items and which item is available.
+ The database provides a clearer view of the flow of product - from the
store to its customer then to the second customer.
+ ERD provides the business a better view of relations between all of the
subjects.
+ The database provides a better way to audit the shop’s data compared to
pens and papers.
2. The downside of the database can be observed as follows:
+ There are not many types of data that can be inserted in for example there
is no option of entering price of the shop’s items, there is no option for
checking the time when item arrived at the shipping company and so on.

13
+ This database lacks real information, there are only 20 samples for each
table, not more, it would be better for the real business if there was more
information.
+ This database lacks options for auditing the items that customers buy and
also the quantity bought by them.
This project will help the business a big deal in storing data and manage the basic data
but not very ideal for auditing.

14

You might also like