Answered step by step
Verified Expert Solution
Question
1 Approved Answer
COMP 3 2 7 8 Introduction to Database Management Systems Assignment 3 - Relational Algebra, Functional Dependency & BCNF Q 1 Consider the following relational
COMP Introduction to Database Management Systems
Assignment Relational Algebra, Functional Dependency & BCNF
Q Consider the following relational tables of FoodWonder, an online food delivery platform:
Restaurants rID name, cruise
Customers CID name, VIP
VIP is a boolean telling whether the customer is a VIP.
Drivers dID name
Orders OID rID, CID, dID, orderTime, arrivaltime,
foodRating, driverRating
Foreign keys:
rID referencing Restaurants YID
CID referencing Customers CID
dID referencing Drivers dID
The time intervals orderTime arrivaltime denotes the period from when the order is
placed by the customer denoted by CID to the time that the driver denoted by IID pass the
deliver to the customer.
Note that arrivalTime can be NULL for ongoing deliveries.
foodRating and driverRating are the ratings that the customer denoted by CID can give in
an order. The rating is an integer from worst to best
Please give the expression trees with some optimizations You can use assignment operator
and more than one trees to answer each question:
Retrieve the driver ID dID and name of the drivers who have completed
more than delivery orders.
Retrieve the restaurant ID rID and name of the restaurants that are
categorized as "Thai" cruise restaurants and have an average food rating
foodRating of or above.
Retrieve the distinct driver ID dID the name of the first restaurant rlname and the
name of the second restaurant name for the drivers who have been or are currently
delivering orders from two restaurants simultaneously, considering overlapping order time
intervals.
The rname and name represent the names of two distinct restaurants involved in
the orders.
Provide a query that utilizes the driverRating column and involves all four tables
Restaurants Customers, Drivers, and Orders in the query execution process.
After providing the textual description of the query, provide the expression tree with
some optimizations for that query.
Q Given the relation schema with the following functional dependencies set
which hold
Find and proof all candidate keys in
Q Given the relation schema with the following functional dependencies set
which hold
If is decomposed to the following and
and
a Is the decomposition dependencypreserving? Explain your answer.
b Suggest two different ways to handle the unpreserved dependencies in the above
decomposition.
Q Given the relation schema with the following functional dependencies set
which hold
Give a lossless join and dependency preserving decomposition of into relations in BCNF Show
your steps and proof.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started