DBS Lab 5
DBS Lab 5
DBS Lab 5
Semester – 4
Database Systems
Lab 5
Requirements:
1. MySQL [Software]
Theory:
The Restaurant Database
Restaurant Database allows users to buy food online. Users can log in using
their e-mail. Users input info on their profile with name, last name, phone
number, their address. Every user has a unique ID.
The restaurant staff consists of a cook, manager, courier, and system
administrator. Cook prepares food, buy products and checks quality of the meal.
The manager keeps order in the restaurant. The system administrator verifies the
quality of working of the database and adds new products to the database. The
courier delivers food to customers. User chooses meal, then this info comes to
the kitchen. Cook prepares food and gives it to courier. The courier delivers this
food and gets paid.
The Customer Table consists of:
Customer_ID *-- A unique integer value for every user
First_Name-- Text that contains customer's first name.
Last_Name-- Text that contains customer's last name.
Gender-- Text that contains customer's gender.
Phone_Number-- Text that contains customer's phone number.
Street-- Text that contains customer's street address information.
City-- Text that contains customer's city information.
E-mail-- Text that contains customer's e-mail address.
The Staff Table consists of:
Staff_ID *-- A unique employee’s ID
First_Name-- Text that contains employee's first name.
Last_Name-- Text that contains employee’s last name.
Gender-- Text that contains info about employee’s gender.
Position-- Text that position of an employee.
The Meal Table consists of:
Meal_ID *-- A unique integer value that guarantees each meal has a unique ID.
Name-- A short text name for the meal for use in reports.
Description-- A longer text description for the meal to help the customer
decide.
Price-- A floating point representation for the price of the meal
Prep_Time-- An integer for the number of minutes the meal takes to prepare.
The Meal_Order Table consists of:
Order_ID *-- An integer value that guarantees each order has a unique ID.
Meal_ID *-- A unique integer value that guarantees each meal has a unique ID.
Quantity-- An integer quantity of a specific meal on the order
Payment_-- An integer value for the order payment method and price
Delivery Time-- An integer value for the time of the delivery
Exercise
(a) List details of all Staff, alphabetically by name.
(b) List the details of a meal by price.
(c) List the details of meal ordered by one person.
(d) List the clients registering.
(e) List all orders with price over Rs.100.
(f) Display details of Meal which takes more minutes to prepare the order.
(g)Display the meal which have price more than Rs.300.