For example, I have two tables.
- Name: Customer
- Primary key: idCustomer
- AnotherColumn: name
- Foreign key: idVendor
Another table:
- Name Vendor
- Primary Key: idVendor
- AnotherColumn: name
I want to create 1:n relation.
Which table is a primary key table and which is a foreign key table?
I think what you mean is which is the 1 and which is the n. The 1 would be vendor the n would be customer. you can have many customers to one vendor but only one vendor per customer.