V
V
Vladislav Garmash2015-12-06 12:50:05
Database
Vladislav Garmash, 2015-12-06 12:50:05

How to link an entire database table to a specific row in another table?

I'm creating a database of public urban transport and ran into several problems.
Since I'm a beginner, I don't know much about MS Access.
The idea is this: I have a route table. It includes the following data: route ID, bus number, route name, fare, distance of the direct / return route, number of stops of the direct / return route, minimum-maximum bus interval (possibly replaced by a schedule), travel time, start / end route work and route working days.
76286d8ac8bc4ba794083403bea14b62.png
There is also a list of all stops where these buses stop
7e47a040422e48f7af633c02a50a29c5.png
AND for one route (1 Bus) there is a list of stops in one direction (and the distance from the previous one to this stop). Naturally, such tables should be for each bus.
ee1a413d654d448eb023e5309ea0ca1f.png
The question is the following. How to correctly link the entire table of route stops (and there will be 2 of them - direct and reverse) with lines in the list of routes (first table)?
Or can it be done in a different and better way? And is it possible to assign the value of a one-dimensional array to a cell in a database table?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artyom Karetnikov, 2016-07-14
@Dynortice

Good. We make an intermediate table. Three fields.
Rid - Random ID for this table,
id_bus - here we write the number of the route
and id_busstop - here we write the stop.
Everything. As many stops per route, as many routes as you want. Well, you can still add a sign, is_direct, bit. If 1 - then direct route, if 0 - reverse.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question