|
Thers are three buses running for a school. Bus No's are 1,2 and 3.
for eg :
Bus No.1 should travel via the following stops in a given sequence
Stop Name Sequence
Stop1 1
Stop2 2
Stop3 3
Stop4 4
Stop5 5
Bus No.2 should travel via the following stops in a given sequence
Stop Name Sequence
Stop1 1
Stop4 2
Stop2 3
Stop3 4
Stop5 5
Bus No.3 should travel via the following stops in a given sequence
Stop Name Sequence
Stop4 1
Stop3 2
Stop2 3
Stop5 4
Stop1 5
Whenever a bus touch any stop the record and time of the bus arrival is been entered in to system
now i want that when the record is entered it should check if the particular bus has come through the proper sequence which means it has not skipped the
pervious stop.
if it has been skipped then record should not be inserted...
how do i check this in SQL???
Can some one give me a rough idea how to tacke this ....
Thanx in Advance
|
|
|
hi sr_aneesh,
first, for each BUS you need to select all the Top 4 busstop which sorted with the arrivaldatetime, then, compare the current busstop.
if your compare the current busstop is not listed, then, you can add the data directly.
but, if you found the current busstop is currently on the list, please ginore the insertion record and give the warning message.
good luck with your assignment.
<Added>
besides that, you have the record which record the sequence busstop to be arrived. then, it will easy for you.
it's all on your mind to solve it. the objectives still same but the admin need always configure the destination on each bus. fortunately, it's the best to plan the route of the bus otherwise, the bus managament will get fully complaint on the bad services. hehehe.
:)
|
|
|
|
|
|
|
|