Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2015

    Unanswered: Tables relations

    I have 4 tables

    Some drivers and buses have only one trip in one school while some have two trips in two different schools..
    Also there are drivers and buses which have no trips, means they are spare drivers and spare buses..
    its easy for me to find spare buses and drivers by creating a query..
    The problem for me is that how can I restrict a driver from a bus once allocated to another driver?? I can't set a unique because one driver can use the bus twice in two different schools... please help me.!!
    Attached Thumbnails Attached Thumbnails 321.png  
    Last edited by alipezu; 12-21-15 at 05:52.

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    you cannot neccesarily enforce every constraint using table design, sometimes you have to do some of the groundwork yourself.
    you can implement stored procedures using triggers.

    what you could do is when trying to allocate a driver to a bus is only show unalloctaed busses. bear in mind that you can run queries, using JOINS which can rerturn rows which are matched, unmatched and so on.
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts