Sei sulla pagina 1di 11

Smart - Menu Database Design Document

CAPSTONE PROJECT 1
SMART - MENU
Database design document
Version 1.0
Date: Nov 12nd, 2019

MENTOR : MSc, Nguyen Thi Thanh


Tam

PROJECT TEAM : Team 8 - PO

TEAM’S MEMBER : Nguyen Manh Cuong

Vo Duy Quyen

Tran Quoc Thinh

Huynh Ba Gia Bao

INTERNATIONAL SCHOOL
Smart - Menu Database Design Document

NUMBER OF A* CHANGE
VERSION DATE FIGURE, TABLE M TITLE OR BRIEF REQUEST
NUMBER OR PARAGRAPH D DESCRIPTION NUMBER
1.0
Smart - Menu Database Design Document

Document Approvals: The following signatures are required for approval of this
document.
Smart - Menu Database Design Document

Contents
CONTENTS....................................................................................................................4
1 INTRODUCTION....................................................................................................5
1.1 Scope, Approach and Methods.....................................................................5
1.2 Related Documents........................................................................................5
2 SUBSYSTEM/APPLICATION OVERVIEW............................................................6
2.1 Hardware and Software Architecture...........................................................6
2.2 Data stores......................................................................................................7
3 DATABASE DESIGN DECISIONS.........................................................................7
3.1 Assumptions...................................................................................................7
3.2 Entity Mapping................................................................................................7
3.3 Mapping rules..................................................................................................7
3.4 Additional Objects..........................................................................................7
3.5 Table Definitions.............................................................................................8
3.6 Table Relationship Diagrams.........................................................................9
3.7 Key mappings...............................................................................................10
3.8 Dependencies................................................................................................10
3.9 Denormalisation............................................................................................10
3.9.1 Performance Improvement............................................................................................ 10
3.9.2 Functional Support......................................................................................................... 11
4 IMPLIED FUNCTIONALITY.................................................................................11
5 DATA ACCESS.....................................................................................................11
6 References............................................................................................................11
Smart - Menu Database Design Document

1 Introduction
This Database Design provides the basis for the Smart-Menu System Database Design. It
defines the database that will support the Smart-Menu System Data Model. It describes both
logical and physical definition, non-functional issues, and the database interfaces; storage
aspects are defined in the physical database design sections. The design is created with
expected data volumes, functional and non-functional usage of the tables, and performance
considerations and requirements in mind.

The following topics are covered in this document:

 Assumptions and decisions on database design


 Entity-mapping
 Table, column definitions
 Primary, unique and foreign key definitions
 Column and row level validation rules (check constraints)
 Rules for populating specific columns (sequences, derivations, denormalised
columns)
 Interfaces and dependencies with other components
 Data access description

1.1 Scope, Approach and Methods


The Database Design for the Smart-menu is composed of definitions for database objects
derived by mapping entities to tables, attributes to columns, unique identifiers to unique keys
and relationships to foreign keys.
During design, these initial definitions are enhanced to support the functionality described in
the functional specification / use cases and defined in the primary and supporting modules of
the application high level design.

1.2 Related Documents


This specification refers to the following documents:
Smart - Menu Database Design Document

2 Subsystem/Application Overview

The Smart-Menu is a web application that allows configuration in two mode: stand-alone or
distributed.

The high-level objectives of Smart-Menu project are to develop a distributed application that
will:

- Selling system

- Select foods/drinks follow requirements, suggest foods/drinks

- Manage a list food Database

- provide a GUI for the simple client, easy to use and be pleasing

2.1 Hardware and Software Architecture


This section provides an overview of the software and hardware architecture. The following
describes the technology components of the Smart-Menu

The technology component of the Smart-menu


Attribute Description

Design Client/ server architecture with distributed and stand-alone configuration

Platform Web

Database Database management system My SQL is used to stored data fields.

Software The Smart-Menu web application was developed as web app with
distributed and stand-alone configuration. The proposed programming
language for the development of the main Smart-Menu application using
ASP.NET MVC

Hardware Application and Database Server

at a minimum
Smart - Menu Database Design Document

2.2 Data stores


This session briefly describe all data stores including databases, file systems and media data
stores.

The Smart-Menu project stores data in My SQL Database. Besides music is stored in audio
file with corresponding formats

3 Database Design Decisions


This section contains the decisions that were made when designing the database for Smart-
Menu. Problems, alternative solutions and motivated choices are listed below. The section
also lists any design assumptions that had to be made. In case the assumptions are results of
ambiguities or lack of details, they will need verifying by the analyst team.

3.1 Assumptions
Some assumptions made due to lack of information, will be update in next version of
database design document:

- Limit of ability of remote administration

3.2 Entity Mapping


This section states the mapping rules and lists tables and columns that either:

3.3 Mapping rules


When mapping entities to tables, the following rules were applied:

 Entities are mapped into tables in a one to one manner.


 Attributes are mapped to columns in a one to one manner.
 One-to-many relationships are mapped to foreign keys.
 Many-to-many relationship are implemented using two one-to-many relationships with
intersection table.

3.4 Additional Objects


The following table lists database objects (tables or columns) that where not derived from an
entity, but were added to the database design for the purpose listed below. This includes
intersection tables used for mapping many-to-many relationships.

Column Table Mapped from Purpose


IdFood Food One-to-many relationships Connect between two table
of food from Primary key
Smart - Menu Database Design Document

3.5 Table Definitions

This session defines all tables of the JukeBox system

Table/column Data type Size Description and propose

Table [dbo].[food] Store information of meals

[Id] INT Id of food/drinks


[FoodName] NVARCHAR 50 Name of food/drink
[Price] INT Demonstrates the price of that foods
[Image] NVARCHAR MAX Image display food/drink
[Description] NVARCHAR MAX Display the information of that
food/dirnk
[FoodTypeId] INT Type of that food
Table [dbo].[foodType] Store type of food
[Id] id of type of food
INT
[TypeName] NVARCHAR 50 Name of type

[dbo].[infomation] Store information of restaurant linking to


social app
[AppName] NVARCHAR 50 Name of app (facebook, twitter…)
[Email] NVARCHAR 50 Email of restaurant
[FanPage] NVARCHAR 50 Fanpage of restaurant
[Decription] NVARCHAR 50 Description about restaurant
[Slogan] NVARCHAR 50 Sologan of restaurant
[dbo].[Users] For login the web application
[UserName] NVARCHAR 50 Username for login
[FullName] NVARCHAR 50 Name of restaurant
[Password] NVARCHAR 50 Password for login
[dbo].[weather] Store information of weather
Id INT Id of name weather
[main] NVARCHAR 50 Name of weather
Smart - Menu Database Design Document

[describe] NVARCHAR 50 Describe information of that weather


[icon] NVARCHAR 200 Icon display the weather
Table dbo].[food_weather] Store information of accounts
[foodId] INT Id of food linking to table [dbo].[food]
column foodid
[weatherId] INT Id of weather linking to table [dbo].
[weather] column id

Comment :
Primary key print in underline, bold

Foreign key print in italics, bold

3.6 Table Relationship Diagrams

The following diagram show the tables for the Smart- Menu schema and their relationships.
The relationships are implemented as foreign key constraints.
Primary key print in bold

Foreign key print in italics, bold


Smart - Menu Database Design Document

3.7 Key mappings


The following tables have primary keys created from sequences:

Table Primary key column Sequence

[dbo].[Food] [Id] Int


[dbo].[foodType] [Id] Int
[dbo].[Users] [UserName] NVARCHAR (50)
[dbo].[weather] [Id] Int
[dbo].[food_weather] [foodId] Int

3.8 Dependencies
List here any dependencies for the Smart-Menu System schema. One type of dependencies
can be foreign keys across schemas. One-to-many relationships are mapped to foreign keys.
List foreign key dependencies here:

Table/ column Table/ column refers to Comments

[dbo].[Food] / [FoodTypeId] [dbo].[foodType] / [Id]


[dbo].[food_weather] / [FooId] [dbo].[Food] /[Id]
[dbo].[food_weather] / [weatherId] [dbo].[weather] / [Id]

3.9 Denormalisation
To improve performance or otherwise support specific functionality, redundancy is sometimes
added to the design. Two types of redundancy are distinguished, performance
denormalisation and functional denormalisation. The first type is aimed at improving
performance, the second is needed to support the proposed functionality of the system.

3.9.1 Performance Improvement


To maintain redundant or denormalised data needed to improve performance, the following
objects were modified:

Denormalised Source table or entity Rules and methods for


Smart - Menu Database Design Document

Table/Column maintaining integrity

3.9.2 Functional Support


To maintain redundant or denormalised data needed to support the proposed functionality of
the following objects were modified:

Denormalised Source table or Rules and methods for


Table/ entity maintaining integrity
Column

4 Implied Functionality
The model contains supporting modules that perform functions that may be trivial to the users
but are considered to be important functionality by the developers. Decisions regarding
database objects involved in such implied functionality are discussed below:

 Security Design
Describe how authentication, integrity and confidentiality requirements are supported
within the database and interfaces to it.

5 Data Access
This section describes aspects on how data defined in this design is used.

6 References
[1] Database design documents of jukebox project (VJS.Userstories.v1.2)

[2] Database design documents of Smart Menu Project ([SM]UserStory_v1.1)

[3]. MySQL - http://en.wikipedia.org/wiki/MySQL

[4]. MySQL tutorial - http://dev.mysql.com/doc/refman/5.0/en/tutorial.html

[5]. Draw Io - https://www.draw.io/

Potrebbero piacerti anche