I'm a beginner with databases and I'm trying to design a database in Microsoft Access that will allow users to make bookings for fitness classes. There are two slots per day that these classes can be booked for and each session can cater for 10 people.
What I am struggling to understand is how I can limit the number of bookings made per session, per day, to ensure nobody can book a class on a session and a day that is already full up. Can anyone offer me any suggestions about how I can achieve this? I have started designing the tables but I know they aren't correct it all feels a bit of a mess.
The tables I have so far:

Customer ID (PK)
Telephone No

Booking ID (PK)
Customer ID (FK)

Class ID (PK)

Session ID (PK)
Number per session

Session_ID (PK)
Class_ID (PK)

Thanks in advance

Recommended Answers

All 6 Replies

Member Avatar

Not sure I'm with you. Is the class a pre-organised one that is set to a session, or are the classes set to a session on an ad hoc basis?

It seems to me that most leisure centres etc, tend to block book classes for a time/day (recurring) for a certain period, e.g. for 8 weeks (or in perpetuity). Members can either sign up to a class and pay for the whole blocked period, or do a pay as you go (if there's room).

Can more than one class be held at the same time, e.g. 6 in one, 4 in the other or are they fixed so that only one class can be held in any particular session?

Ok well to simplify my question completely let's say I had a session and the maximum amount of people that book the session was 10. How would I limit the number of bookings that can be made for it to 10 per day?

Member Avatar

Using a conditional construct:

    count of records for that session < 10
    insert record into the table
    report session full

What is the relationship between customers and numbers of booking on your Access database?

A customer can make many bookings

Can you show all the relationships? It is hard to understand from words

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.