You are on page 1of 27

CAPSTONE PROJECT II

CMU-SE 450
DATABASE DESIGN
Version 1.0
Date: April 14th, 2023

Online Service Market System

Submitted by
Quan Tran Anh
Khiem Le Do Hoang
Phuc Truong Gia
Thuan Huynh Van
Truong Nguyen Lam

Approved by
Huy Nguyen Dang Quang M.Sc.

Proposal Review Panel Representative:

Name Signature Date

Capstone Project 2 - Mentor:

Name Signature Date


[Online Service Market System] Database Design Ver 1.0

PROJECT INFORMATION

Project
OSM
acronym

Project title Online Service Market System

Start date February 21th, 2023 End Date May 20th, 2023

Lead institution International School, Duy Tan University

Huy Nguyen Dang Quang M. Sc


Project mentor Email: huyndq@duytan.edu.vn
Phone: 0935525354

Partner
Duy Tan University
organization

Scrum Master Quan Tran Anh anhquan74.dev@gmail.com 0362474855

25211200029 Quan Tran Anh anhquan74.dev@gmail.com 0362474855

25211203121 Khiem Le Do ledohoangkhiem3k@gmail.c


0348597672
Hoang om

25211217162 Phuc Truong Gia katanan257@gmail.com 0981864173

25214302052 huynhvanthuan.140921@g
Thuan Huynh Van 0824644573
mail.com

25211217426 Truong truongnguyen13052001@g


0353373477
Nguyen Lam mail.com

DATABASE DESIGN DOCUMENT


Document Title Database Design Document

Author(s) C2SE.08 Team

Role C2SE.08-DatabaseDesign-OSM

Date April 14th, 2023 File C2SE.08-DatabaseDesign-OSM

C2SE.08 TEAM 2
[Online Service Market System] Database Design Ver 1.0

name:
URL

Access Project and CMU Program

REVISION HISTORY
Version Person(s) Date Description

Initiate document, finish content


1.0 Khiem April 14 , 2023
th
of document

C2SE.08 TEAM 3
[Online Service Market System] Database Design Ver 1.0

SIGNATURE
Document Approvals: The following signatures are required for approval of this
document.

Signature:
Mentor Huy Nguyen Dang Quang
M.Sc. Date:

Signature:
Scrum Quan Tran Anh
master Date:

Signature:
Khiem Le Do Hoang
Date:

Signature:
Phuc Truong Gia
Date:
Team
member( Signature:
s) Thuan Huynh Van
Date:

Signature:
Truong Nguyen Lam
Date:

C2SE.08 TEAM 4
[Online Service Market System] Database Design Ver 1.0

Contents

1. Introduction 7
1.1. Purpose
1.2. Document Objectives
1.3. Intended Audience
1.4. Scope
1.5. System Overview
1.6. Acronyms And Abbreviations
2. System Overview 9
2.1. Database Management System Configuration
2.2. Database Software Utilities
2.3. Support Software
3. Database-Wide Design Decisions 9
3.1. Key Factors Influencing Design
3.2. Performance And Availability Decisions
4. Database Administrative Functions 10
4.1. Responsibility
4.2. Applications/Systems Using the Database
4.3. Physical Design
4.3.1. Maps DB
4.3.1.1. Facility
4.3.1.2. Building
4.3.1.3. Floor
4.3.1.4. Place Type
4.3.1.5. Place
4.3.1.6. Space Type
4.3.1.7. Space
4.3.2. VR 360
4.3.2.1. 360 Image
4.3.2.2. 360Links

C2SE.08 TEAM 5
[Online Service Market System] Database Design Ver 1.0

4.3.3. Geojson DB
4.3.3.1. Point
4.3.3.2. Connection
4.3.4. Users DB
4.3.4.1. User
4.3.4.2. Device
4.3.4.3. Profile
4.3.4.4. Friend
4.3.5. Photos DB
4.3.5.1. Collection Overview
4.3.5.2. Schemas
4.3.5.3. Specified Properties
4.3.5.4. JSON Structure
4.3.5.5. Details
4.3.5.5.1. FacilityPhotosRecord
4.3.5.5.2. BuildingPhotosRecord
4.3.5.5.3. FloorPhotosRecord
4.3.5.5.4. PlacePhotosRecord
4.3.5.5.5. SpacePhotosRecord
4.4. Entity Mapping
4.4.1. Entity Mapping Diagram
4.4.2. Industry
4.4.2.1. Users
4.4.2.2. Friends
4.4.2.3. Maps
4.4.2.4. Geojson
4.4.2.5. Directions
4.4.2.6. Photos
5. References 31

C2SE.08 TEAM 6
[Online Service Market System] Database Design Ver 1.0

1. Introduction
1.1. Purpose
- Setting up an overview about the database of Online Service Market web
application.
- Provides database tables and the relationship between them.
- Description designing a database (DB), a collection of data related to storage
on a computer through database management system as a basis for data query
related software.
- Provide the entire needed database for OSM web application.
1.2. Document Objectives
The Database Design Document has the following objectives
o To describe the design of a database, that is, a collection of related data
stored in one or more computerized files that can be accessed by users or
developers via a DBMS.
o To serve as a basis for implementing the database and related software
units. It provides the acquirer visibility into the design and provides
information necessary for software development.
1.3. Intended Audience
- This document is intended for the following audiences
- Technical developers, who must evaluate the quality of this document
- Developer including:
o Architects, whose overall architecture design must meet the requirements
specified in this document.
o Designers, whose design must meet the requirements specified in this
document.
o Developers, whose software must implement the requirements specified in
this document. Quality Assurance personnel, whose test cases must validate
the requirements specified in this document.

C2SE.08 TEAM 7
[Online Service Market System] Database Design Ver 1.0

1.4. Scope
- This Database Design Document provides the basic database design of OSM
web application.
- It describes both logical and physical definition, non-functional, database
interfaces, tables, code create tables.
- It includes the tables and performance considerations and requirements. The
following topics are covered in this document:
o Assumptions and decisions on database design
o Entity – mapping
o Table, column definitions
o Column and row level validation rules (check constraints)
o Interfaces and dependencies with other components.
- This Database Design Document of Online Service Market web application is
composed of definitions for database objects derived by mapping entities to
tables, attributes to columns, unique identifiers to unique keys and relationship
to foreign keys.
1.5. System Overview
System Overview Details
Online Service Market
System Name

System Type Web application


Operational Status In development

1.6. Acronyms And Abbreviations


Acronym/Abbreviation Meaning
Online Service Market
OSM

RDMS Relational Database Management System


DBMS Database Management System
DB Database

C2SE.08 TEAM 8
[Online Service Market System] Database Design Ver 1.0

2. System Overview
2.1. Database Management System Configuration
- System: MS Windows
- Vendor: Digital Ocean
- Services enabled: Linux Virtual Machine
2.2. Database Software Utilities

Vendor Product Version Comments


This application enables the ability
Oracle MySQL
8.0 to manage MySQL database using
Corporation Workbench
GUI.

2.3. Support Software

Product Version Purpose


MySQL
8.0 Generate ERD diagram of MySQL database.
Workbench

3. Database-Wide Design Decisions


3.1. Key Factors Influencing Design
- The database should be designed independent when the frontend and backend
are still being developed.
- The database should be designed to meet the data warehouse principles.
3.2. Performance And Availability Decisions
We use common dimensional tables for all the fact tables for better
performance

C2SE.08 TEAM 9
[Online Service Market System] Database Design Ver 1.0

4. Database Administrative Functions


4.1. Responsibility

Role Name Responsibility Email Address


Database Khiem Le Do ledohoangkhiem3k@gmai
Administrator Hoang l.com

System and
Security anhquan74.dev@gmail.co
Quan Anh Tran
m
Administrator

4.2. Applications/Systems Using the Database

System ID Model Version System Code

OSM-Web NA In Development NA

C2SE.08 TEAM 10
[Online Service Market System] Database Design Ver 1.0

4.3. Physical Design


4.3.1. Detail table
4.3.1.1. User

Field Type Constraint Nullable Description


bigInt,
The id is the primary
id autoIncrem PK False
key for User record.
ent

varchar,
email False The email of the user.
unique

The password of the


password varchar False
user.

The full name of the


full_name varchar False
user.

birthday timestamp True The birthday of the user.

gender varchar True The gender of the user.

The phone number of


phone_number varchar True
the user.

avatar varchar True The avatar of the user.

The introduction about


introduction text True
the provider.

The provider liked by


is_favorite tinyInt True
customer

Provider operating
is_working tinyInt True
status

C2SE.08 TEAM 11
[Online Service Market System] Database Design Ver 1.0

total_rate bigInt True

total_star bigInt True

avg_star float True

clicks bigInt True

views bigInt True

click_rate float True

User account status (soft


is_valid tinyInt True
delete)

Date and time the record


created_at timestamp False
was created.

Date and time the record


updated_at timestamp False
was last updated.

C2SE.08 TEAM 12
[Online Service Market System] Database Design Ver 1.0

4.3.1.2. Location

Field Type Constraint Nullable Description


bigInt,
The id is the primary key
id autoIncrem PK False
for location record.
ent

User identification number.


user_id bigInt FK False
Foreign key to User.id

province_id bigInt True The id of the province.

province_nam
varchar False The name of the province.
e

district_id bigInt True The id of the district.

district_name varchar True The name of the district.

ward_id bigInt Tue The id of the ward.

ward_name varchar True The name of the ward.

coords_latitud The latitude of the user’s


True
e location.

coords_longitu The longitude of the user’s


True
de location.

is_primary

Date and time the record


created_at timestamp False
was created.

Date and time the record


updated_at timestamp False
was last updated.

C2SE.08 TEAM 13
[Online Service Market System] Database Design Ver 1.0

C2SE.08 TEAM 14
[Online Service Market System] Database Design Ver 1.0

4.3.1.3. Banner

Field Type Constraint Nullable Description


bigInt, The id is the primary
id PK False
autoIncrement key for banner record.

User identification
provider_id bigInt FK False number. Foreign key
to User.id.

The image of the


image varchar True
banner.

Date and time the


created_at timestamp False
record was created.

Date and time the


updated_at timestamp False record was last
updated.

C2SE.08 TEAM 15
[Online Service Market System] Database Design Ver 1.0

4.3.1.4. Post

Field Type Constraint Nullable Description


bigInt, The id is the primary key
id PK False
autoIncrement for banner record.

User identification
author_id bigInt FK False number. Foreign key to
User.id.

title varchar True The title of the post.

content text True The content of the post.

image image True The image of the post.

date timestamp True Post creation date.

tags varchar True The tags of the post.

is_valid tinyInt True Post status (soft delete)

Date and time the record


created_at timestamp False
was created.

Date and time the record


updated_at timestamp False
was last updated.

4.3.1.5. Category

Field Type Constraint Nullable Description


bigInt, The id is the primary key
id PK False
autoIncrement for category record.

name varchar True The name of the category.

The logo image of the


logo varchar True
category.

C2SE.08 TEAM 16
[Online Service Market System] Database Design Ver 1.0

total_provid
int True The number of provider.
er

view_priorit
bigInt True
y

Category status (soft


is_valid tinyInt True
delete)

Date and time the record


created_at timestamp False
was created.

Date and time the record


updated_at timestamp False
was last updated.

4.3.1.6. Service

Field Type Constraint Nullable Description


bigInt, The id is the primary key
id PK False
autoIncrement for service record.

Category identification
category_id bigInt FK False number. Foreign key to
Category.id.

User identification
provider_id bigInt FK False number. Foreign key to
User.id.

avg_price bigInt True Average price of service.

The highest price of the


max_price bigInt True
service.

The lowest price of the


min_price bigInt True
service.

C2SE.08 TEAM 17
[Online Service Market System] Database Design Ver 1.0

is_negotiabl
tinyInt True
e

total_rate bigInt True

total_star bigInt True

avg_star float True

number_of_
bigInt True
packages

is_valid tinyInt True Service status (soft delete)

Date and time the record


created_at timestamp False
was created.

Date and time the record


updated_at timestamp False
was last updated.

4.3.1.7. Package

Field Type Constraint Nullable Description


bigInt, The id is the primary key
id PK False
autoIncrement for service record.

Service identification
service_id bigInt FK False number. Foreign key to
Service.id.

name varchar True The name of the package.

The description of the


description text True
package.

price bigInt True The price of the package.

total_rate bigInt True

C2SE.08 TEAM 18
[Online Service Market System] Database Design Ver 1.0

total_star bigInt True

avg_star float True

is_negotiable tinyInt True

view_priorit
bigInt True
y

Package status (soft


is_valid tinyInt True
delete)

Date and time the record


created_at timestamp False
was created.

Date and time the record


updated_at timestamp False
was last updated.

4.3.1.8. Appointment

Field Type Constraint Nullable Description


bigInt, The id is the primary
id autoIncreme PK False key for appointment
nt record.

Package identification
package_id bigInt FK False number. Foreign key to
Package.id.

User identification
customer_id bigInt FK False number. Foreign key to
User.id.

Service status (soft


is_valid tinyInt True
delete)

note_for_provid varchar True The note of customer

C2SE.08 TEAM 19
[Online Service Market System] Database Design Ver 1.0

er for provider.

The location of the


location varchar True
appointment

The time occur of the


date timestamp True
appointment

The price of the


price bigInt True
appointment

The unit of
price_unit varchar True
appointment’s price

The status of the


status varchar True
appointment

The time that the


complete_date timestamp True appointment is
completed

The time when the


cancel_date timestamp True appointment was
rejected

The time on which the


offer_date timestamp True
appointment is offered

Date and time the


created_at timestamp False
record was created.

Date and time the


updated_at timestamp False record was last
updated.

4.3.1.9. Feedback

C2SE.08 TEAM 20
[Online Service Market System] Database Design Ver 1.0

Field Type Constraint Nullable Description


The id is the primary
bigInt,
id PK False key for feedback
autoIncrement
record.

Appointment
identification
appointment_id bigInt FK False
number. Foreign key
to Appointment.id.

Comment of
comment varchar True customer for the
appointment.

Reply of provider for


reply varchar True
customer’s comment.

Number of star for


star bigInt True appointment
(customer’s rate).

reply_at date True

Date and time the


created_at timestamp False
record was created.

Date and time the


updated_at timestamp False record was last
updated.

C2SE.08 TEAM 21
[Online Service Market System] Database Design Ver 1.0

4.3.1.10. Favorite

Field Type Constraint Nullable Description


bigInt, The id is the primary
id autoIncreme PK False key for feedback
nt record.

User identification
customer_id bigInt FK False number. Foreign key
to User.id.

User identification
provider_id bigInt FK False number. Foreign key
to User.id.

Date and time the


created_at timestamp False
record was created.

Date and time the


updated_at timestamp False record was last
updated.

4.3.1.11. Notify

Field Type Constraint Nullable Description


bigInt,
The id is the primary
id autoIncreme PK False
key for notify record.
nt

User identification
customer_id bigInt FK False number. Foreign key
to User.id.

provider_id bigInt FK False User identification


number. Foreign key

C2SE.08 TEAM 22
[Online Service Market System] Database Design Ver 1.0

to User.id.

content varchar True The content of notify.

Check if customer
is_cus_deleted tinyInt True deleted the notify (for
hard delete)

Check if provider
is_prov_deleted tinyInt True deleted the notify (for
hard delete)

Date and time the


created_at timestamp False
record was created.

Date and time the


updated_at timestamp False record was last
updated.

4.3.1.12. Message

Field Type Constraint Nullable Description


bigInt, The id is the primary
id autoIncreme PK False key for message
nt record.

User identification
customer_id bigInt FK False number. Foreign key
to User.id.

User identification
provider_id bigInt FK False number. Foreign key
to User.id.

C2SE.08 TEAM 23
[Online Service Market System] Database Design Ver 1.0

The content of
content varchar True
message.

Date and time the


created_at timestamp False
record was created.

Date and time the


updated_at timestamp False record was last
updated.

C2SE.08 TEAM 24
[Online Service Market System] Database Design Ver 1.0

4.4. Entity Mapping


4.4.1. Table relationship diagram

C2SE.08 TEAM 25
[Online Service Market System] Database Design Ver 1.0

C2SE.08 TEAM 26
[Online Service Market System] Database Design Ver 1.0

5. References
- [SDA] 006 Database Design.docx (Man, Nguyen Duc).
- https://drawsql.app/teams/dac-1/diagrams/osm

C2SE.08 TEAM 27

You might also like