SQL Server Database Design – Determine Direction of Relationship

database-designprimary-keyrelational-theorysql server

Suppose I have the following relationship diagram:

Diagram

How would you describe the relationship determined by the red line?

Reading from left to right you would say each order has only one customer so it could be described as a "many to one" whereas from right to left each customer can have many orders so you could say it is "one to many".

Without direction it seems to me to be futile to try and discuss a relationship yet I rarely see people say, it is a one to many (from customer to order) or many to one (from order to customer).

So my question is why is this the case (is it just implied from context?) or does the primary key have some relation, as in we wouldn't really store an order_ID in the customer table (I am not a DBA but I don't think this make sense from a design point of view) whereas we would have to store a customer as a foreign key in the order table otherwise we wouldn't know who bought the stuff, so would this give precedence to reading from right to left and we say the red line is a one to many relationship?

Any clarification would be great!

Best Answer

A Foreign Key always refers to a Unique Index or Primary Key. So the "one" side is always the one where the related columns are a key.