Вы находитесь на странице: 1из 4

CS Catering Case Study

• CS Catering provides catering services. They have several choices of menus. The Head
Chef will enter information about each menu. Each menu has a menu_id, menu_type,
description and cost_per_pax. Each menu has one or more dishes. The dish has a
dish_id, dish_name and prep_time. Each dish also uses one or more ingredients, and
one ingredient may be used in many different dishes. An ingredient has an
ingredient_ID, ingredient_name and unit_of_measurement. The amount of each
ingredient used in each dish is also recorded.

• CS Catering has many clients, some use their services regularly. Each client has a
client_id, name and contact number. Each client may use their services for one or more
events. When the Manager receives information about a new event, they will record
who the client is and information about the event such as the event_title, date, time,
location, number_of_pax . The client will then choose a menu for the event.

• The manager will record information about staff. Each staff has a name, emp_id,
hourly_pay and a supervisor who is another staff member. The manager will also assign
staff to events. When a staff is assigned to an event, their position at the event (eg
waiter, server, chef), start_time and end_time needs to be recorded.

TASKS

Based on the CS Catering case study, you are required to:

TASK 1
Identify the information required in the case study including entities, relationships,
cardinalities, and participation.

Entities: menu, dish, ingredient, client, event, staff

Relationships:
Menu has dish
Dish consist-of Ingredients
Client creates Event
Menu for Event
Staff assigned-in Event
Cardinalities and Participation:
1 Menu has 1/M Dishes, 1 Dish in 1 menu
1 Dish consist-of 1/M Ingredients, 1 Ingredient in 0/M Dishes
1 Client creates 1/M Events, 1 Event created-by 1 Client
1 Menu for 1/M Events, 1 Event has 1 Menu
1 Staff assigned-in 0/M Events, 1 Event assign 1/M Staffs.

TASK 2

Develop ONE complete Entity Relationship Diagram (ERD) in 3NF using Crows’ foot notation
for cardinalities. You must show the entities, composite entities, relationships, cardinalities
and any optionalities. Please use DIA software to develop your ERD. Your ERD should not
show attributes.

TASK 3

Develop the Relational Data Model (RDM) which corresponds to the ERD in Task (2). That
is, the set of tables in third normal form that could be used to represent the whole of this data
model. Your RDM should identify primary and foreign keys and presented in the format:

TABLENAME (attribute1, attribute2, attribute3 …)


PRIMARY KEY attribute1
FOREIGN KEY attribute3 REFERENCES table_name (attribute name)
Menu (Menu_ID, Type, Description, CostPerPax)
Primary Key: Menu_ID
Foreign Key : none

Dish(Dish_ID, Dish_Name, Prep_time, Menu_ID)


Primary key: Dish_ID
Foreign Key: Menu_ID references Menu (Menu_ID)

Ingredients(ingredient_ID, ingredient_name and unit_of_measurement,)


PK: ingredient_ID
FK: none

DishIngredients(ingredient_ID, dish_ID, amount_used)


PK : ingredient_ID, dish_ID
FK: ingredient_ID references ingredient(ingredient_ID), dish_ID references dish(dish_ID)

Event(event_title, date, time, location, number_of_pax)


PK: event_title
FK: Menu_ID references menu(Menu_ID), Client_ID references client(client_ID)

Client(client_id, name, contact number)


PK: client_id
FK: none

Staff(name, emp_id, hourly_pay, supervisor)


PK: emp_id
FK: none

EventStaff(emp_id, event_title, staff_position, start_time, end_time)


PK: emp_id, event_title
FK: emp_id, references Staff(emp_id), event_title references Event(event_title)

TASK 4

Develop the Physical database design, use the following template of table to develop the
physical database design:

Table 3: Sample of physical database design

Table name: Category table


Field Name Data Type Remark
CategoryID INT(20) Primary Key NOT NULL
CategoryName VARCHAR(50) NOT NULL
CategoryType INT(5) Foreign key references Type (TypeID)

Self-exercise
Sample RDM for ‘menu’ table:

Table name: Menu table


Field Name Data Type Remark
Menu_ID INT(20) Primary Key NOT NULL
Menu_Type VARCHAR(50) NOT NULL
Description VARCHAR(50)
CostPerPax DECIMAL(6,2)

TASK 5

Implement the Physical database design using MySQL Workbench DBMS. You are required
to insert at least 3 records for each table. You are required to provide SQL codes (queries to
create table and insert records) and result of table (snapshot from MySQL Workbench) for each
table.

Self-exercise.

Вам также может понравиться