Project Detail

MySQL Queries  

MySQL Queries is project number 294626
posted at Freelancer.com. Click here to post your own project.

 

| More Free Trial For New Buyers
 

Status:

Selected Providers: Pektsekye

Budget: $30-250

Created: 08/01/2008 at 4:20 EDT

Bid Count: 11

Average Bid:
N/A

08/04/2008 at 4:20 EDT

Project Creator: Organic
Employer Rating: 10/1010/1010/1010/1010/1010/1010/1010/1010/1010/10 (10 reviews)

Bid On This Project
 

Description

I need a couple of MySQL5 select queries created for two tables (attached) on an existing holiday villa availability calendar.

The first query is to sort out prices by dates from table availabilitybookingcalendar_prices so it reads:

Price 150 from 2008-07-01 to 2008-07-23
Price 300 from 2008-07-24 to 2008-08-09
Price 600 from 2008-08-10 to 2008-08-28
Price 400 from 2008-08-29 to 2008-09-20
Price 300 from 2008-09-21 to 2008-11-06
Price 150 from 2008-11-07 to 2008-11-26
Price 600 from 2008-11-27 to 2008-12-17 etc.

I need to make a price list for a holiday villa. The pricelist would need to ignore periods where there is no price, show price lists from the current month and order the pricelist by date.

-----------------------------------------------------------------

The 2nd query combines both tables availabilitybookingcalendar_prices and availabilitybookingcalendar_reservations to make a search for available dates below a maximum price.

For example a search for availability between arrival on 14 August 2008 and departure on 21 August 2008 max price 400 would return false because dates are not available, but a search for arrival on 20 August 2008 and departure on 25 August 2008 max price 400 would return true as the dates are free and the price is below 600.

There is a potential problem in that the system has half dates for some of the beginning and ends of the booked period so these days would need to be seen as free.

I use PHP version 5.2.5

MySQL version 5.0.51a-community


Additional files submitted:
price.sql
reservation.sql

Messages Posted:0 View project clarification board Post message on project clarification board

Bid On This Project
 

If you are the project creator or one of the bidders Log In for more options

Bids are hidden by the project creator. Log in as the project creator or as one of the bidders to view bids. You will not be able to bid on this project if you are not qualified in one of the job categories. To see your qualifications click here.


    Bid on this Project