Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Group all stays by the percent difference from rate was from the base price. For each grouping, list the percent difference (e.g., 15% off the

Group all stays by the percent difference from rate was from the base price. For each grouping, list the percent difference (e.g., 15% off the base price would show as -15) and the total number of days with that percent difference. Sort the results by the total number of days in ascending order.

Expected:

percent total_days
-15 162
25 208
-10 458
15 510
0 833

Tables:

rooms:

RoomCode RoomName Beds bedType maxOcc basePrice decor
AOB Abscond or bolster 2 Queen 4 175 traditional
CAS Convoke and sanguine 2 King 4 175 traditional
FNA Frugal not apropos 2 King 4 250 traditional
HBB Harbinger but bequest 1 Queen 2 100 modern
IBD Immutable before decorum 2 Queen 4 150 rustic
IBS Interim but salutary 1 King 2 150 traditional
MWC Mendicant with cryptic 2 Double 4 125 modern
RND Recluse and defiance 1 King 2 150 modern
RTE Riddle to exculpate 2 Queen 4 175 rustic
TAA Thrift and accolade 1 Double 2 75 modern

reservations: (

Field Type Null Key Default Extra
CODE int NO PRI null
Room char(5) YES MUL null
CheckIn date YES null
Checkout date YES null
Rate float YES null
LastName varchar(15) YES null
FirstName varchar(15) YES null
Adults int YES null
Kids int YES null

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 Universal Database V7.1 Application Development Certification Guide

Authors: Steve Sanyal, David Martineau, Kevin Gashyna, Michael Kyprianou

1st Edition

0130913677, 978-0130913678

More Books

Students also viewed these Databases questions