Found a really good explanation in the PostgreSQL documentation.
Say that you have a product table that we have already used several times:
CREATE TABLE products ( product_no integer PRIMARY KEY, name text, price numeric );
Suppose also that you have a table in which orders of these products are stored. We want the order table to contain only orders of products that really exist. Thus, we define the foreign key constraint in the order table, which refers to the product table:
CREATE TABLE orders ( order_id integer PRIMARY KEY, product_no integer REFERENCES products (product_no), quantity integer );
It is now impossible to create orders with product_no entries that are not displayed in the product table.
We say that in this situation, the order table is the reference table, and the product table is the reference table. Similarly, there are links and columns that are referenced.
abruski
source share