You are on page 1of 15

ASSIGNMENT 1 FRONT SHEET

Qualification TEC Level 5 HND Diploma in Computing

Unit number and title Unit 04: Database Design & Development

Submission date Date Received 1st submission

Re-submission Date Date Received 2nd submission

Student Name Phung Huu Minh Khanh Student ID GDD210033

Class GCD1102 Assessor name Do Duy Thao

Student declaration

I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand
that making a false declaration is a form of malpractice.

Student’s signature Km

Grading grid

P1 M1 D1
❒ Summative Feedback: ❒ Resubmission Feedback:

Grade: Assessor Signature: Date:


Signature & Date:
Table of Contents
I. STATEMENTS OF USER AND SYSTEM REQUIREMENTS (P1). ........................................................................................................... 5
1. Overview about the problem. .................................................................................................................................................... 5
2. Requirements of the application................................................................................................................................................ 5
II. DESIGN THE RELATIONAL DATABASE SYSTEM (P1) ........................................................................................................................ 5
1. Analyze the requirements.......................................................................................................................................................... 5
2. Database design with explanations. ........................................................................................................................................... 6
 Explaining for ERD ...................................................................................................................................................................... 7
 Explaining the relationship between tables .............................................................................................................................. 10
 Data types: ............................................................................................................................................................................... 13
 Database Diagram:. .................................................................................................................................................................. 15
Table of Figure
Figure 1: ERD for Restaurant Manager System. .................................................................................................................................... 6
Figure 2: Example for Customer Table. ................................................................................................................................................. 7
Figure 3: Example for Bill Table. ........................................................................................................................................................... 7
Figure 4: Example for Order Table. ....................................................................................................................................................... 8
Figure 5: Example for Food Table. ........................................................................................................................................................ 8
Figure 6: Example for Chef Table. ......................................................................................................................................................... 9
Figure 7: ERD of ‘Customer’ Table and ‘Bill’ Table............................................................................................................................... 10
Figure 8: ERD of ‘Chef’ Table and ‘Food’ Table.................................................................................................................................... 11
Figure 9: ERD of ‘Food’ Table and ‘Order’ Table.................................................................................................................................. 12
Figure 10: ERD of ‘Bill’ Table and ‘Order’ Table. .................................................................................................................................. 13
Figure 11: Database Diagram. ............................................................................................................................................................ 15

Table of Tables
Table 1: Data types of ‘Customer’ Table. ............................................................................................................................................ 13
Table 2: Data types of ‘Bill’ Table........................................................................................................................................................ 14
Table 3: Data types of ‘Order’ Table. .................................................................................................................................................. 14
Table 4: Data types of ‘Food’ Table. ................................................................................................................................................... 14
Table 5: Data types of ‘Chef’ Table. .................................................................................................................................................... 15
I. STATEMENTS OF USER AND SYSTEM REQUIREMENTS (P1).
1. Overview about the problem.
Today, there is an increasing number of students, with universities receiving more students, and there is a growing
demand for on-campus restaurants for breaks and meals. Because of the increased speed, the restaurant's
management system often has errors and difficulties in management. For that reason, this project aims to make
restaurant management easier, more convenient and more efficient than before. In addition, this project also helps the
restaurant to manage more things needed in the restaurant, so that the restaurant can develop in the future on the
campus of university.
2. Requirements of the application.
 The restaurant has a management system consisting of 3 positions as well as the user's role as Chef, staff at
the restaurant and customers.
o As a staff in Restaurant:
 I want to save the information of the dishes on the dining tables and display the customer's
previous table orders.
 I want to correct the information about the dish if I have a problem with the wrong order.
 I want to check the total number of dishes on the dining table with the table number and
information of the customers sitting there
 I want to check the information with the matched system and change it if there is an error.
o As a customer in Restaurant:
 I want to check the dishes and the total number of dishes on the table and check if my bill and
payment information match or not.
o As a Chef:
 I want to keep track of ingredients to make dishes.
 I want to change the price of the food when I have economic problems.
 I want to be able to see other chefs with their dishes.
 I want to monitor whether the dishes are on the right table or not.

II. DESIGN THE RELATIONAL DATABASE SYSTEM (P1)


1. Analyze the requirements.
Reports came out in the school restaurant area that there were a few unresolved issues:
 The problem of customers' slow and time-consuming payment and order
 The problem of slow dishes.
 The problem is that the staff at the restaurant can't handle it in time and face many difficulties in the case of a
large number of customers.
 The problem of lack of drink.
=> Therefore, the restaurant has decided and learned from the above problems to change the restaurant management
method. The restaurant system will be updated continuously for staff and receptions to know to capture information
of customers and employees as well as chefs.
2. Database design with explanations.

Figure 1: ERD for Restaurant Manager System.


Explaining for ERD: This diagram includes 5 tables with the values that have been saved into the system and the necessary
data.
o ‘Customer’ Table: Customer table consists of primary key Id. In addition, the table has other attributes such as
FullName, Gender, and Phone. The above information is for the purpose of providing information about customers.

Figure 2: Example for Customer Table.

o ‘Bill’ Table: Bill table consists of primary key is Id and foreign key is CustomerId. Besides, it also includes information
about Date, TableNumber and Total to provide the necessary information on the Bill.

Figure 3: Example for Bill Table.

o ‘Order’ Table: Order table includes Id as primary key and 2 foreign keys FoodId and BillingId. Also includes
OrderTime, Quantity and OPrice to provide information while ordering.
Figure 4: Example for Order Table.

o ‘Food’ Table: The Food table includes Id as the primary key of the table and ChefId as a foreign key, in addition, it
includes the Name, Category and unit price of the dish to provide information on the Order table.

Figure 5: Example for Food Table.


o ‘Chef’ Table: Chef table includes primary key Id. Besides, the table also has information related to the chef such as
FullName, Gerder, Phone and Address to provide information of the chef.

Figure 6: Example for Chef Table.


Explaining the relationship between tables:
o Relationship between ‘Customer’ Table and ‘Bill’ Table: The two tables are linked by CustomerId. Each customer
entering the restaurant will have a separate bill. In addition, Customer can ability to come to the restaurant
several time to have dinners/lunches.
=> One-to-many relationship.

Figure 7: ERD of ‘Customer’ Table and ‘Bill’ Table.


o Relationship between ‘Chef’ Table and ‘Food’ Table: The two tables are linked by ChefId. With each chef can cook
many dishes and many dishes can be from one chef.
=> One-to-many relationship.

Figure 8: ERD of ‘Chef’ Table and ‘Food’ Table.


o Relationship between ‘Food’ Table and ‘Order’ Table: With an Order Id associated with a dish. And for each dish,
there will be many times of Order.
=> One-to-many relationship.

Figure 9: ERD of ‘Food’ Table and ‘Order’ Table.


o Relationship between ‘Bill’ Table and ‘Order’ Table: With a Bill, there will be many Orders to pay for the ordered
number of dishes and each Bill will correspond to a customer CustomerId
=> One-to-many relationship

Figure 10: ERD of ‘Bill’ Table and ‘Order’ Table.

Data types:
o ‘Customer’ Table:
Column Name Data Type
CustomerId Int
FullName Nvarchar(50)
Gender Nvarchar(10)
Phone Varchar(10)
Table 1: Data types of ‘Customer’ Table.
o ‘Bill’ Table:
Column Name Data Type
BillId Int
CustomerId Int
Date DATETIME
TableNumber Int
Total Int
Table 2: Data types of ‘Bill’ Table.

o ‘Order’ Table:
Column Name Data Type
OrderId Int
BillId Int
FoodId Int
OrderTime DATETIME
Quanity Int
OPrice int
Table 3: Data types of ‘Order’ Table.

o ‘Food’ Table:
Column Name Data Type
FoodId Int
Name Nvarchar(50)
Category Nvarchar(20)
UnitPrice Int
Table 4: Data types of ‘Food’ Table.
o ‘Chef’ Table:
Column Name Data Type
ChefId Int
FullName Nvarchar(50)
Gender Nvarchar(10)
Address Nvarchar(100)
Table 5: Data types of ‘Chef’ Table.

Database Diagram: Tables, characteristics, and relationships are common features of both ERD and database diagrams,
as shown in the image of the database diagram above ERD, on the other hand, clearly illustrates the primary and foreign
keys so that the reader can understand the system.

Figure 11: Database Diagram.

You might also like