Database Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesDatabase Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
  #1  
Old September 1st, 2002, 11:12 PM
lido lido is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Posts: 6 lido User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Database Design help

I have an issue with database design and i was wondering if anyone would be able to give me a hand.

basically this database would be used to organise accomodation. Basically the user signs up. They are given 2 weeks a year for 3 years in our resort. The user organisation is fine the thing we are having problems with is the unit organisation database or tables.

every unit is identified by a unique id (eg. gfr157 is a id used currently) every user is identified by a unique username.

the issue that we are having trouble with is designing a table that shows the unit id, username, year 1, year 2, year 3, week 1, week 2, week 3, week 4, week 5, week 6

we have tryed several ways of doing this. The most obvious being the table above. But if you look at it closesly the weeks arent actually assigned to a year so a query in php like SELECT year_1, week_1 FROM units WHERE year_1 = '2002' && week_1 = '1'. would have exactly the same out put if the year was 2003, 2004 etc.

The main thing that needs to be done is we have to be able to tell if a week has been taking. By first checking if the week and year combination are already taken. which in a way is simple enough. But it has to be able to check if the week and year combination is available over several different units.

i have had lots of trouble with this. so i thought i would pass it on to others to see if anyone can see a way this can be acheived.

Even if you have the slightest idea please post it. Any help is better than none.
Thanks in advance.

P.S. in using MySQL server if that helps

Reply With Quote
  #2  
Old September 1st, 2002, 11:57 PM
mytch mytch is offline
Dev Articles Novice (500 - 999 posts)
 
Join Date: Apr 2002
Location: Sydney, Australia
Posts: 589 mytch User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Hi Lido,
I would recommend having three tables: One for the hotels, one for weeks and one for years. You can then inner join them:

select * from hotels
inner join months on hotels.hotelId = months.hotelId
where months.month = 9

... or something similar to this? That way you can have unlimited bookings.

Reply With Quote
  #3  
Old September 14th, 2002, 10:00 AM
seymourab seymourab is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Location: Anguilla, B.W.I.
Posts: 1 seymourab User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
It seems to me that rather that the system that you are considering a better approach might be to label the weeks as follow: year1_week1, ....,year1_week52, year2_week1, ....,year2_week52,year3_week1, ....,year3_week52

I hope this provides some help. Of course you might even want to use even shorter labels like yr1w01 to yr1w52

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesDatabase Development > Database Design help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five &quot;checkpoints&quot; for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway