0% found this document useful (0 votes)
27 views20 pages

C2SE.23 DatabaseDesign MR

The document provides a database design for a music recommendation web application. It includes 10 database tables to store user, song mood, playlist, and other application data. Relationship mappings are defined between the tables to support necessary queries. The database will be implemented using SQLite and managed through a database management system.

Uploaded by

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

C2SE.23 DatabaseDesign MR

The document provides a database design for a music recommendation web application. It includes 10 database tables to store user, song mood, playlist, and other application data. Relationship mappings are defined between the tables to support necessary queries. The database will be implemented using SQLite and managed through a database management system.

Uploaded by

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

CAPSTONE PROJECT 2

DATABASE DESIGN DOCUMENT

Music Recommendation
CODE: DATABASE DESIGN
Date : March 01, 2023

Submitted by
Lam, Nguyen Viet Minh
Thi, Pham An
Thanh, Nguyen Tan
Huy, Chau Ngoc

Approved by Mentor
Man, Nguyen Duc PhD

Database Design Review Panel Representative:

Name Signature Date

Capstone Project 2 - Mentor:

Name Signature Date


Project Information

Project acronym MR

Project Tittle Music Recommendation

Start Date 05 March 2023 End Date 20 May 2023

Lead Institution International School, Duy Tan University

Project Mentor Man, Nguyen Duc, Ph.D.


Email: [email protected]
Phone: 0904235945

Project Manager Lam, Nguyen Viet Minh


& contact details Email: [email protected]

Tel: 0935040813

Partner
Organization

Team members Name Email Tel

Lam, Nguyen Viet Minhlamnguyenviet@g 0935040813


Minh mail.com

Thi, Pham An [email protected] 0787350188

Thanh, Nguyen Tan Thanhdatofficial4@gmai 0848999299


l.com

Huy, Chau Ngoc chaungochuy0801@gmai 0905293654


l.com

C2SE.23 TEAM 2
DATABASE DESIGN DOCUMENT

Document Title Database Design Document

Author(s) C2SE.23

Role C2SE.23-DatabaseDesign

C2SE.23-DatabaseDesign-
Date March 01, 2023 File name:
MR

URL

Access Project and CMU Program

REVISION HISTORY

Version Person(s) Date Description

Initiate document, finish content


1.0 Lâm March 01, 2023
of document

Update Database User, Admin


1.1 Lâm April 15, 2023
part.

1.2 All member May 1, 2023 Final Document.

C2SE.23 TEAM 3
SIGNATURE

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

Signature:

Mentor Man, Nguyen Duc, PhD Date:

Signature:
Lam, Nguyen Viet Minh
Scrum master Date:

Signature:
Thi, Pham An
Date:

Signature:
Thanh, Nguyen Tan
Date:

Team
Signature:
member(s) Huy, Chau Ngoc
Date:

C2SE.23 TEAM 4
Contents

1. Introduction.......................................................................................................... 7
1.1. Purpose......................................................................................................................7
1.2. Document Objectives...............................................................................................7
1.3. Intended Audience....................................................................................................7
1.4. Scope..........................................................................................................................7
1.5. System Overview......................................................................................................7
1.6. Acronyms and Abbreviations..................................................................................7
2. System Overview....................................................................................................8
2.1. Database Management System Configuration......................................................8
2.2. Database Software Utilities......................................................................................8
2.3. Support Software......................................................................................................8
3. Database-Wide Design Decisions..........................................................................8
3.1. Key Factors Influencing Design..............................................................................8
3.2. Performance and Availability Decisions................................................................8
4. Database Administrative Functions.....................................................................9
4.1. Responsibility............................................................................................................9
4.2. Applications/Systems Using the Database..............................................................9
4.3. Physical Design.........................................................................................................9
4.3.1.1. api_user...............................................................................................................9
4.3.1.2. api_user_groups...............................................................................................10
4.3.1.3. api_user_user_permission...............................................................................10
4.3.1.4. api_songmood...................................................................................................11
4.3.1.8. api_play_list.....................................................................................................12
4.3.1.9. api_play_list_add.............................................................................................13
4.3.1.10. api_song_love................................................................................................13
4.3.1.7. Authtoken............................................................................................................14
4.4. Entity Mapping..........................................................................................................16
4.4.1. Entity Mapping Diagram.......................................................................................16
4.4.2. Industry...................................................................................................................17

C2SE.23 TEAM 5
4.4.2.1. Users (Role Admin and User).............................................................................17

4.4.2.2. Mood Songs....................................................................................................17


4.4.2.3. Late songs.......................................................................................................18
4.4.2.4. Playlist.............................................................................................................18
4.4.2.5. Song love.........................................................................................................19
4.4.2.6. Authtoken.......................................................................................................19
5. References................................................................................................................19

C2SE.23 TEAM 6
1. Introduction
1.1. Purpose
- Setting up an overview of the database of Music Recommendation 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 Music Recommendation web
application.
1.2. System Overview

System Overview Details

System Name Music Recommendation

System Type Web application

Operational Status In development

1.3. Acronyms and Abbreviations

Acronym/Abbreviation Meaning

MR Music Recommendation

SQL SQLite

RDMS Relational Database Management System

DBMS Database Management System

DB Database

C2SE.23 TEAM 7
2. System Overview
2.1. Database Management System Configuration
- System: Windows
- Vendor:
- Services enabled:
2.2. Database Software Utilities

Vendor Product Version Comments


SQLite is a software library that
provides a relational database
management system(RDBMS). The
design goals of SQLite were to
C Sqlite 3
allow the program to be operated
without installing a database
management system(DBMS) or
requiring a database administrator

2.3. Support Software

Product Version Purpose


Sqlite 3 Generate ERD diagram of Sqlite database.

3. Database-Wide Design Decisions


3.1. Key Factors Influencing Design
- The database should be designed independently 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.23 TEAM 8
4. Database Administrative Functions
4.1. Responsibility

Role Name Responsibility Email Address

Database Lam, Nguyen Viet minhlamnguyenviet@gm


Administrator Minh ail.com

System and minhlamnguyenviet@gm


Security Lam, Nguyen Viet ail.com
Minh
Administrator

4.2. Applications/Systems Using the Database

System ID Model Version System Code

MR-Web NA In Development NA

4.3. Physical Design


4.3.1. Recruitment DB
4.3.1.1. api_user

Constrain
Field Type Nullable Description
t
ID is the primary key for
api_users. This field is
id int PK False
populated automatically
by the database program.
username varchar(150) False The username of the User.
password Varchar(128) False The password of the User.
email Varchar(245) False The email of the User
first_name Varchar(150) False The first name of the User
last_name Varchar(150) False The last name of the User
is_superuser bool False Superuser's identity
last_login datetime True User's last login time
is_staff bool False Staff's identity

C2SE.23 TEAM 9
is_active bool False Users are active
date_joined datetime False User login date

4.3.1.2. api_user_groups

Field Type Constraint Nullable Description


ID is the primary key
for api_user_groups .
id integer PK False This field is populated
automatically by the
database program.
Identify users. Foreign
user_id bigint FK False
key to api_user.id
ID for group. This
field is populated
group_id integer False
automatically by the
database program.

4.3.1.3. api_user_user_permission

Field Type Constraint Nullable Description


ID is the primary key
for
api_user_user_permis
id int PK False sion. This field is
populated
automatically by the
database program.
Identify users. Foreign
user_id bigint FK False
key to api_user.id
ID for
permission.This field
permission_id integer False is populated
automatically by the
database program.

1
C2SE.23 TEAM
0
4.3.1.4. api_songmood

Constra
Field Type Nullable Description
int
ID is the primary key for
api_songmood. This field
id int PK False
is populated automatically
by the database program.
mood Varchar(50) False Mood for the song

4.3.1.5. api_song_mood

Field Type Constraint Nullable Description


ID is the primary key for
api_song_mood. This
id int PK False field is populated
automatically by the
database program.
Identify song. Foreign key
song_id bigint FK False
to api_song.id
Identify song mood.
songmood_ Foreign key to
bigint FK False
id
api_songmood.id

4.3.1.6. api_song

Constra
Field Type Nullable Description
int
ID is the primary key for
Mood Song. This field is
id int PK False
populated automatically by
the database program.
artist Varchar(150) True Artist for the song
duration Varchar(10) True Duration for the song

1
C2SE.23 TEAM
1
poster Varchar(100) True Duration for the song
mp3_file Varchar(100) True Mp3_file for the song
love Varchar(150) False Love for the song
name Varchar(150) True Name of the song

4.3.1.7. api_late_song

Field Type Constraint Nullable Description


ID is the primary key for
Late songs. This field is
id int PK False
populated automatically
by the database program.
The name of the Late
name Varchar(150) True
song
artist Varchar(150) True The artist of the Late song
The duration of the Late
duration Varchar(10) True
song
The poster of the Late
poster Varchar(350) True
song
The mp3_file of the Late
mp3_file Varchar(350) True
song
id_Song Varchar(150) True Id of the Song
User_Link
Bigint FK True Foreign key to api_user.id
_id

4.3.1.8. api_play_list

Field Type Constraint Nullable Description


ID is the primary key for
api_play_list. This field is
id int PK False
populated automatically
by the database program.
name Varchar(150) True The name of the Playlist
artist Varchar(150) True The artist of the Playlist

1
C2SE.23 TEAM
2
The duration of the
duration Varchar(10) True
Playlist
poster Varchar(350) True The poster of the Playlist
The mp3_file of the
mp3_file Varchar(350) True
Playlist
id_Song Varchar(150) True Id of the Song
Play_list_Li Foreign key to
Bigint FK True
nk_id api_play_list_add.id

4.3.1.9. api_play_list_add

Const
Field Type Nullable Description
raint

ID is the primary key for


api_play_list_add. This
id int PK False field is populated
automatically by the
database program.

name Varchar(150) True The name of the Playlist

User_Link_id Bigint FK True Foreign key to api_user.id

4.3.1.10. api_song_love

Field Type Constraint Nullable Description

It is the primary key


for api_song_love. It
id int PK False is populated
automatically by the
database program

1
C2SE.23 TEAM
3
The name of the Song
name Varchar(150) True
love

The artist of the Song


artist Varchar(150) True
love

The duration of the


duration Varchar(10) True
Song love

The poster of the Song


poster Varchar(350) True
love

The mp3_file of the


mp3_file Varchar(350) True
Song love

id_Song Varchar(150) True Id of the Song

Foreign key to
User_Link_id Bigint FK True
api_user.id

4.3.1.7. Authtoken

Field Type Constraint Nullable Description

It is the primary key for


Authtoken. It is
digest Varchar(128) PK False populated automatically
by the database
program.

created Datetime False Authtoken creation

1
C2SE.23 TEAM
4
time.

Foreign key to
user_id Bigint FK False
api_user.id.

The token key used in


token_key Varchar(8) False
the transaction.

expiry datetime True Authtoken expiry date.

1
C2SE.23 TEAM
5
4.4. Entity Mapping
4.4.1. Entity Mapping Diagram

1
C2SE.23 TEAM
6
4.4.2. Industry
4.4.2.1. Users (Role Admin and User)

4.4.2.2. Mood Songs

1
C2SE.23 TEAM
7
4.4.2.3. Late songs

4.4.2.4. Playlist

1
C2SE.23 TEAM
8
4.4.2.5. Song love

4.4.2.6. Authtoken

1
C2SE.23 TEAM
9
5. References

- DB Schema Database Design: DBeaver (v 23.0.1)

2
C2SE.23 TEAM
0

You might also like