Is it possible to use part of a composite primary key as a foreign key to another table? In my attempt to model a one to many relationship, I am trying to achieve the following in SQL (MariaDB) given my basic DB knowledge:


Profiles Table:
Primary Key: profileName &lt;-----
                              |
Repositories Table:           |
Composite Primary Keys: (profileName, repository_name)


Is this a possibility?
This is certainly possible and even very reasonable in many situations. Think for instance to the classical Order and OrderLine tables, in which the OrderLine has as primary key the order number and the line number, with order number foreign key for the Order table.