MySQL Forums
Forum List  »  MyISAM

Re: Novice / Intermediate user seeks help in structuring data / tables
Posted by: Jeff Sabarese
Date: December 16, 2005 01:15AM

Jay,

hey there! thanks again for your help. after re-reading your earlier post where you laid out the tables-- i want to be sure that we're "on the same page" here because i get the strong feeling that you have made an excellent set of tables for a completely different kind of bus system than what i'm dealing with here

mine is an "around downtown" trip planner, not a trip planner for Greyhound type bus. so, i wont be dealing with "max passengers"-- and i don't need to assign busses to routes-- because at the touch of a button, the driver can change the variable message sign on the front (and back) of the bus-- IN FACT, some of the buses actually become another route at the end of one of their route trips

imagine a clock face for this illustration-- w/ a RED line and a Blue line, one inside of the other, but basically the same radius (to represent left lane north-bound, and right lane south-bound-- of course, then it couldn't be a circle... but you get the idea, i hope).
the red lane, starting at 9 o' clock starts north-bound heading toward 12 o' clock, and the blue lane, also at 9 o' clock starts south bound toward 6 o' clock. they each arrive at 3 o' clock simultaneously. at this point, instead of each bus doing a 180 degree turn, they each flip their signs. so the red lane is now the blue line, and vice versa. same physical bus, different route description. this way, between 9 , 6 and 3 o' clock on the on the clockface (not in time), it's ALWAYS the blue-line. at the bus-stop at 6 o' clock on the clockface, i can stand on the left side of the road and catch a "blue route" going in either direction, depending on if i need to get to 3 o' clock, or 9 o' clock-- this way, there are more options for the riders. wow-- that's really a weird system, isn't it?!? but, that's what i'm dealing w/ here-- basically-- except imagine the routes also take different streets on both n and s bound trips and all kinds of crazy shit to hit every place in town. sorry for all this crazyness, but i felt i needed to try to explain it at this point.

okay-- now that i have that squared away... heehee...
since our last conversation here, i settled on 3 tables for each route:

1 - bus-stop ID - for linking other tables together as a primary foreign key, both intra-route, and extra-route for the other bus routes' 3 tables
2 - bus-route timetable - for showing at what time of day this bus-route is at which bus-stop
3 - bus-stop details - for compiling detailed data about each bus-stop

i believe that in this manner, i should be able to get everything i need in terms of queries and linking-- but then again, i haven't tried to do anything extremely complex yet, nor have i tried querying route-x against route-y simultaneously for special searches -- which will be the whole point of the "trip planner", really i guess. ;)

but, i don't have any data duped in any table-- and, until i think of something to add for a better, more precise "trip planner", i think i have all of my necessary bits of data, each in its own unique field now. table 1 (the id table) of course is duping info which is in both table 2 and 3, but that's the whole point there really, right?

please view the screen captures i made for you here:
http://adesigninteractive.com/fileshare/mysql/

actually-- if you check my most recent posts, you'll probably see that i've moved beyond this table stuff-- for now at least-- (not to say that there isn't always room for improvement!), AND i've also taken a little break from it so there's not a whole heck of a lot more here-- but, coincidentally-- i'm goign to start on it again here directly (like in the next 5 mins!) ;)
so, do please keep an eye out for me as i'm probably going to be back here real soon.

off of the top of my head-- if you're out there-- since my next challenge/ attempt is going to be to get this app to actually try to "Plan a Trip", i'm trying to think of which pieces of data i can compare mathematically so that my equation will evaluate to an output of telling the Trip Planner user when to go to the bus-stop closest his starting point, and it should at the same time indicate at what time the bus will arrive at the selected destination. like i said, i haven't started the html / php for this part yet-- but i have some ideas. anything you feel like throwing my way in terms of that part i would be MOST grateful. thanks!

-- -- -- --
Use CSS [ content:" ?? " ] for Unicode + Control Chars (e.g. newline, etc)... Gain understanding of Codepage, Charset, Encoding, Keymapping... Generate CSS and JavaScript on-the-fly with PHP... Tales from the Communications Dept @ NoviceNotes.Net

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.