[Example] Relations reflected by list boxes in forms. In this example, the entire functionality relies on automatic primary keys although no primary key is visible in the forms and reports.
If you are wondering how to create a compound primary key in table edit mode, you select one column, then ctrl+click a second column and right-click mark them as PK.
In the example database open the relations window (Tools>Relations).
The mapping table "P_T" between "Persons" and "Things" has been created with a compound primary key consisting of 2 columns which are also foreign keys pointing to their respective detail table.
-- This table does not allow any duplicate combinations of "PID" and "TID" because that would violate the primary key.
-- This table does not allow any "PID" that does not exist in the primary key of the "Persons" table because that would violate the foreign key.
-- This table does not allow any "TID" that does not exist in the primary key of the "Things" table because that would violate the foreign key.
The detail tables "Persons", "Animals" and "Things" only have a name field and an auto-ID because this is about foreign keys, primary keys and the resulting relations. The item names are for the user interface (forms) while the keys work automatically in the background.
However, I added an additional unique index to the name fields. Open for instance the "Animals" for editing and then open the index designer (menu:Tools>Index Design). There is one index SYS_IDX_90 representing the primary key and a second "uniqueAnimalName" created by me. It enforces unique animal names. You can't enter the same name twice. SInce the column type is VARCHAR_IGNORECASE and this column is not nullable, any valid row in this table has to include a distinct animal name where "Dog", "dog", "DOG" etc would be rejected as duplicates.
These additional indices beyond the primary and foreign keys can also be added without uniqueness. In this latter case they just improve the lookup performance. Think of a hidden table storing each item's locations.