I need to define and generate primary key for 2 or more tables.
Tables hold same type of data but FOR Some BUSINESS RULES we have to make them separate say like
What you are trying to implement is referred to as subtypes: special cases of the same kind of object. There are a few common ways to implement it:
(there are more ways, but these are most useful, and most popular)
I would advise vehementlyu against all kinds of "smart" keys. Of course, you can have a " type" column in your table (the one for the base type) to quickly determine what you are dealing with. But a key scheme like you are suggesting is just complicating things with no real value.