Information générale
Catégorie:
Codage, syntaxe et commandes
I would agree with Hilmar on primary keys being unseen data - we tend to use an integer iID in every table as the primary.
To ensure that nobody books the same slot, you could just index on date, index on time, index on room (I use the term room meaning whatever it is that you're booking) and then have code that looks a bit like...
SELECT * FROM Bookings ;
WHERE iRoom = liRoom ;
AND cTimeSlot = lcTimeSlot ;
AND dWhen = ldWhen
IF _Tally > 0
?'already used'
ELSE
?'can proceed'
ENDIF
If your timeslots are fixed (eg. always half an hour), I'd be tempted to have a table of them [iID i, cDescription c(10)] and reference them as integers. If they are non-fixed you might want to reference them using start and endtimes. Either way, you can just index each field and let rushmore do the rest ;-)
HTH,
JC
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement