473,320 Members | 1,961 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

table structure for seasonal pricing for members and guest

omerbutt
638 512MB
Hi all ,
i need to add pricing structure for bookings , what do you people suggest, minimum how much tables would be needed for this.
Expand|Select|Wrap|Line Numbers
  1.  
  2. Winter        
  3.                                       Member    Guest
  4.  
  5. Weekend                                  40         50
  6.  
  7. Weekday                                  30         40
  8.  
  9. Weekend Special                          60         75
  10.  
  11. Weekday special (sun – Thursday) 120 / 5 nights    200 / 5 nights
  12.  
  13.  
  14. Summer        
  15.  
  16. Weekend                                  30         35
  17.  
  18. Weekday                                  25         30
  19.  
  20. Weekend Special                          45         55
  21.  
  22. Weekday special (sun – Thursday)    100/ 5 nights     140 / 5 nights
  23.  
  24.  
regards,
Omer Aslam
Oct 28 '11 #1

✓ answered by omerbutt

well patjones i carried it out with 3 tables namely, hope you could suggest the best of the 2

jos_seasons(seasons listings)
jos_gbr(guest booking rates)
jos_mbr(member booing rates)
Expand|Select|Wrap|Line Numbers
  1. jos_seasons
  2. season_id     bigint(20) Primary     Index     
  3. season_name     varchar(255)
  4.  
  5. jos_gbr
  6. gbr_id             bigint(20) auto_increment     Primary    gbr_weekday     decimal(19,2)             
  7. gbr_weekend     decimal(19,2)             
  8. gbr_weekday_sp     decimal(19,2)             
  9. gbr_weekend_sp     decimal(19,2)             
  10. season_id     int(20)
  11.  
  12. jos_mbr
  13.  
  14. mbr_id     bigint(20)             
  15. mbr_weekday     decimal(19,2)             
  16. mbr_weekend     decimal(19,2)             
  17. mbr_weekday_sp     decimal(19,2)             
  18. mbr_weekend_sp     decimal(19,2)             
  19. season_id     bigint(20)
  20.  
  21.  

4 2077
patjones
931 Expert 512MB
Hi omer,

I would keep it in one table, like this:

Expand|Select|Wrap|Line Numbers
  1. fldSeasonID fldCost   fldSeason
  2.  
  3. 1            50.00     Winter Weekend (Guest)           
  4. 2            40.00     Winter Weekend (Member)
  5. 3            40.00     Winter Weekday (Guest)
  6. ...          ...       ...
  7. 16          140.00     Summer Weekday Special (Guest)
Oct 31 '11 #2
omerbutt
638 512MB
well patjones i carried it out with 3 tables namely, hope you could suggest the best of the 2

jos_seasons(seasons listings)
jos_gbr(guest booking rates)
jos_mbr(member booing rates)
Expand|Select|Wrap|Line Numbers
  1. jos_seasons
  2. season_id     bigint(20) Primary     Index     
  3. season_name     varchar(255)
  4.  
  5. jos_gbr
  6. gbr_id             bigint(20) auto_increment     Primary    gbr_weekday     decimal(19,2)             
  7. gbr_weekend     decimal(19,2)             
  8. gbr_weekday_sp     decimal(19,2)             
  9. gbr_weekend_sp     decimal(19,2)             
  10. season_id     int(20)
  11.  
  12. jos_mbr
  13.  
  14. mbr_id     bigint(20)             
  15. mbr_weekday     decimal(19,2)             
  16. mbr_weekend     decimal(19,2)             
  17. mbr_weekday_sp     decimal(19,2)             
  18. mbr_weekend_sp     decimal(19,2)             
  19. season_id     bigint(20)
  20.  
  21.  
Nov 2 '11 #3
patjones
931 Expert 512MB
Hi Omer,

Actually...let me think this one over a little. I want to make sure you get the correct normalization. I'll get back to you shortly.

Pat
Nov 2 '11 #4
patjones
931 Expert 512MB
What do you think about this structure? (I used SQL Server data types, by the way - so you would need to modify those for MySQL). You have three look-up tables like this:

Expand|Select|Wrap|Line Numbers
  1. tblRateType
  2.  
  3. fldRateID (tinyint)     fldRateType (varchar(75))
  4.  
  5. 1                       Weekend
  6. 2                       Weekday
  7. 3                       Weekend Special
  8. 4                       Weekday Special
Expand|Select|Wrap|Line Numbers
  1. tblUserType
  2.  
  3. fldUserTypeID (tinyint)    fldUserType (varchar(10))
  4.  
  5. 1                          Member
  6. 2                          Guest
  7.  
Expand|Select|Wrap|Line Numbers
  1. tblSeason
  2.  
  3. fldSeasonID (tinyint)     fldSeason (varchar(10))
  4.  
  5.  1                        Winter
  6.  2                        Summer

Then you have a main rate table:

Expand|Select|Wrap|Line Numbers
  1. tblRates
  2.  
  3. fldSeasonID  fldPatronType  fldDayType  fldRate
  4.  
  5. 1            1              1            40
  6. 1            1              2            30
  7. 1            2              3            75
  8. ...          ...            ...          ...
Nov 2 '11 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Dariusz | last post by:
I have written a database that counts the number of times a file has been accessed, so I can then later display the results on what is "hot" and what is not. At the moment all it does is count the...
0
by: Priscilla Walther | last post by:
Hi All - I'm a newbie to the database area, but have inherited a MySQL database to manage along with my development duties. We have a very large MySQL database, and the designer of the...
0
by: QWERTY | last post by:
--------------Boundary-00=_O5I3QL80000000000000 Content-Type: Multipart/Alternative; boundary="------------Boundary-00=_O5I3LVC0000000000000" --------------Boundary-00=_O5I3LVC0000000000000...
0
by: Randall Sell | last post by:
Hello all, I am migrating a Paradox application to SQL Server. My problem is that the existing Paradox table structure is limited. Correcting it will mean a re-write of the application (Delphi...
4
by: Robert Stearns | last post by:
For testing purposes I propose to add a schema (testing, how original) and would like to copy some of my live tables to it, both structure and data. I know I could use something like dump/restore...
5
by: Stewart Allen | last post by:
Hi all, I'm designing a club database and have encountered a problem when trying to extract the total amount of fees that a Student/Family is suppose to pay during their time of membership. I've...
3
by: ChadDiesel | last post by:
Hello everyone. I need some advice on table structure for a new project I've been given. One of our customers sends us an Excel spreadsheet each week containing their order. Currently, someone...
1
by: Jim | last post by:
Hi, I want to add a field to a table in a database that is live and being accessed from the web. I'm using phpMyAdmin and when I try to add the field I get error #1142...
0
by: m3rajk | last post by:
I've recently become the defacto DBA of two MSSQL databases at work because I am the only one with SQL experience. I have been asked to do some tasks with the databases but this requires and...
3
by: jc | last post by:
Hello. I want to ask about the possibility of copying both a table structure and it's contents from a SQL server table to a table within MS access. The problem cannot be solve with a permanent...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.