Re: Urgent Help Required

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: John Viescas (JohnV_at_nomail.please)
Date: 03/22/04


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
>
>


Relevant Pages

  • Re: The Carlton Airport Hotel near Dublin at $200.00 US was a disappointment to this American
    ... and in 5/18 and out 5/19 online and figured I would verbally cancel ... at a charge of 1 euro for each 15 minutes online. ... another hotel near the airport in Philadelphia Pennsylvania USA ... plus an online non refundable "booking fee" unheard of in the USofA ...
    (rec.travel.europe)
  • Re: Urgent Help Required
    ... FROM Driver, Booking ... hotels in London and then write a query that uses that as input to get the ... Average per hotel. ... "Running Microsoft Access 2000" ...
    (microsoft.public.access.queries)
  • Re: Urgent Help Required
    ... >London per what? ... >For the second problem, you need tables Room and Booking, ... hotel considers the ... >> I want to write following queries in MS Access 2000 ...
    (microsoft.public.access.queries)
  • Re: Hotel Booking Project Delemma
    ... when there are two different people assigned to One Hotel Booking, ... Smith and Jones booked into the same Hotel as a double ... So Smith and Jones come from the Member Table & are linked to the ... HotelBookings via the tblHotelBookingsToMembers. ...
    (microsoft.public.access.tablesdbdesign)
  • Urgent Help Required
    ... Table Name: Hotel ... Primary Key: RoomNo,HotelNo ... Table Name: Booking ... I want to write following queries in MS Access 2000 using ...
    (microsoft.public.access.queries)