如何在 MySQL db 中存储路线中的站点?

How to store stops in routes in MySQL db?

我正在 php 做一个项目 MySQL 我想设计一条动态跟踪面包车的路线。我现在面临的问题是如何在数据库中停车,因为我只知道如何在数据库中存储起点和终点,但知道如何在点之间停止

route(r_id, start_point,end_point)

当有很多路线,起点和终点不同,不同路线的停靠点也不同

point(p_id,...)
route(r_id,start_point,end_point)
stop(r_id,stop_number_within_route,p_id)

参见 及其问题。摘录:

The tables in a relational database describe the state of an application. Each table has an associated fill-in-the-(named-)blanks statement (predicate).

The parameters of the predicate are the columns of the table.

The rows that make a table's predicate true go in the table. The rows that make if false stay out.

You need to decide on sufficient predicates to be able to fully describe the the stituations of your application. This includes abstract things like routes and transactions and events and schedules and assignments etc. (Once we have sufficitent predicates/tables we improve them via techniques like normalization.)