Question: hotels users flights Attributes with black background are the primary key attributes of a relation, e . g . , usercode is the primary key
hotels
users
flights
Attributes with black background are the primary key attributes of a relation, eg usercode is the primary key
of the relation users.
The attribute usercode of relation hotels and flights is a foreign key to the attribute usercode of relation users.
Q: Write the SQL query that will generate each of the tables and the relations between the
tables.
Q: Write an SQL query that returns the average hotel price per user. The hotel price is the sum
of priceper
Q: Write a relational bag semantics algebra for Question
Question Write an SQL that returns double bookings, ie pairs of travelcode and usercode for the
same hotel where the dates overlap.
Question Points Write a relational bag semantics algebra for Question
Question Points Classify travels into the following categories based on the total costs of flight and hotel ie
total price for flight total price for hotel: i If the total costs for flight and hotel are above then Luxury trip;
ii If the total costs for flight and hotel are below then Cheap trip; iii Otherwise, the trip is Regular The
query result should include the travelcode for the hotel and flight and tripclass that determines the class of the trip.
Question Points Write a relational bag semantics algebra that computes the total number of flights and the
total price of flights for each company and flighttype.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
