Foreign key
A foreign key keeps child rows pointing at real parents. ON DELETE decides what happens when the parent goes.
task
Add stops(stop_id, trip_id): a stop needs an existing trip and is deleted with it.
Run a query to see rows here.
Run EXPLAIN on the statement under the cursor: Plan tab, button Explain.
No tables yet.
A foreign key keeps child rows pointing at real parents. ON DELETE decides what happens when the parent goes.
Add stops(stop_id, trip_id): a stop needs an existing trip and is deleted with it.