Re: Urgent Help Required
From: John Viescas (JohnV_at_nomail.please)
Date: 03/22/04
- Next message: MGFoster: "Re: Update two fields in a Query"
- Previous message: MGFoster: "Re: need to know who if there are no records"
- In reply to: Vasant: "Urgent Help Required"
- Next in thread: Vasant: "Re: Urgent Help Required"
- Reply: Vasant: "Re: Urgent Help Required"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 22 Mar 2004 14:18:38 -0600
Hmmmm. This sounds awfully like a homework assignment.
The first question is ambiguous. Average number of bookings per hotel in
London per what? Day? Week? Month?
For the second problem, you need tables Room and Booking, count by Type, and
sort the count descending.
For the third problem, you need to work with the Room table and use NOT IN
with a subquery on the Booking table to find out which rooms are not
occupied "today" (use the Date() function). Keep in mind that DateFrom is
this sort of database indicates the checkout date. The hotel considers the
room "not occupied" on this date unless another booking shows someone
checking in on the same day. Sum the price of the rooms found.
-- John Viescas, author "Microsoft Office Access 2003 Inside Out" "Running Microsoft Access 2000" "SQL Queries for Mere Mortals" http://www.viescas.com/ (Microsoft Access MVP since 1993) "Vasant" <anonymous@discussions.microsoft.com> wrote in message news:cee901c41047$d9703b30$a001280a@phx.gbl... > Hi, > > I need urgent help on following queries > > Database design > =============== > Table Name: Hotel > Fields: HotelNo,HName,City > Primary Key: HotelNo > > Table Name: Room > Fields: RoomNo,HotelNo,Type,Price > Primary Key: RoomNo,HotelNo > > Table Name: Booking > Fields: HotelNo,GuestNo,DateFrom,DateTo,RoomNo > Primary Key: HotelNo,GuestNo,DateFrom > > Table Name: Guest > Fields: GuestNo,GuestName,GuestAddress > Primary Key: GuestNo > > I want to write following queries in MS Access 2000 using > SQL query only > > 1)What is the average no. of bookings for each hotel in > London > > 2) What is the most commonly booked room type for each > hotel in London > > 3) What is the lost income from unoccupied rooms at each > hotel today. > > Kindly provide me only SQL Queries. I have a limitation > and do not want to use Macros, etc.. > > Thanks > >
- Next message: MGFoster: "Re: Update two fields in a Query"
- Previous message: MGFoster: "Re: need to know who if there are no records"
- In reply to: Vasant: "Urgent Help Required"
- Next in thread: Vasant: "Re: Urgent Help Required"
- Reply: Vasant: "Re: Urgent Help Required"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|