Tag Info

Hot answers tagged

1

Your Altered_Files design is absolutely fine. In fact I would award bonus points for separating the files per se from the hierarchy. @chillworld's suggestion is workable and very common but yours is better because of the NULL issues you mention. I can't think of any update which is better in one schema or the other. Change a single row - either the file ...


1

What you seek is a table like the one below, from which you could query: SELECT * FROM departures WHERE route_id = 'SOME_ROUTE' -- This is the code to a route, encompassing from/where AND departure_date = @some_day AND departure_time_min <= @target_time AND departure_time_max >= @target_time I present a solution where such table is ...


1

Let's say you made the table like this CREATE TABLE TrainEvents ( id INT NOT NULL AUTO_INCREMENT, station_arr_id INT NOT NULL, station_dep_id INT NOT NULL, arr_dt DATETIME NOT NULL, dep_dt DATETIME NOT NULL, ... PRIMARY KEY (id), KEY station_arr_index (station_arr_id,arr_dt), KEY station_dep_index (station_dep_id,dep_dt) ...



Only top voted, non community-wiki answers of a minimum length are eligible