After several years of programming applications, I'm looking to refresh my understanding of databases. What I knew to begin with was fairly basic, and honestly, it's disappeared over time. I figured I could get an example and then come here to get a better understanding about the basics of relationships between tables.
Let's say I have the following three tables, describing train trips between three cities in the American Midwest.
The first is called TrainRide:
The second is called Customer:
The final table is called Journey:
I'm trying to figure out the primary keys, foreign keys, and relationships (one-to-many, many to many, etc.) of the tables. I've figured out that TrainRide's primary key is TrainNo. Customer's primary key is CustomerId. What I don't understand is the foreign key and primary keys of Journey, and I can't figure the _ to _ relationships between the tables.
I know this is more about the theory behind databases, but I figured this would be the place to ask.