Assigning a domain value to a primary key is a practice that goes all the way to the point where Cobol programmers and dinosaurs walked the earth together. The practice has been preserved to this day most often in outdated inventory systems. This is basically a way to eliminate one or more columns of data and nesting the data from the excluded column (s) in a PK value.
If you want to keep the client and the supplier in the same table, just do it and use an auto-incrementing integer PK and add a ContactType column or something similar that can contain the values of "S" and "C" or something else, you do not need a compound primary key.
You can always combine these columns (PK and ContactType) in reports, for example. C12345, S20000 (casting integers to a string), if you want to exclude a column to save space (i.e., on a printed or displayed page), and everyone in your organization understands the agreement that the first character of the object identifier is for ContactType code .
This approach will use the auto-increment capabilities built into the database engine to simplify your PC and associated code at the data level and make your program and database more reliable.
source share