While, of course, it is preferable if the FK matches the type and size of the data, there may be times when this is not practical (or even a good idea). In your case, the above PK is larger and, therefore, it will not cause problems in entering data into the second table, since they will only enter those that are 50 characters or less (to do the opposite, where the child table field is larger, it will be pointless sa, you you can never enter data in excess of PK). Depending on what the data is in the first table, this may actually prevent you from entering values ββfrom the original table, in which you never need FK. However, you will have a problem if you want to associate a PK record with a length of 118 characters.
Let us look at the case of a table that was improperly designed, and the field was too large, and historically some data received what we want to save, but we will not communicate in any new tables. Perhaps now we apply a smaller size through a trigger or restriction or through an application. In the new child table, we only want to join the records that correspond to the current needs, and tera will never need to join the older longer records. In this case, creating a second table to get a shorter length is a good idea.
There are also cases where an intial table can contain different types of data (say, a keystore), and a child table can refer to only one type, and this type has a shorter length than is allowed in the parent table to account for different types. Again, using a shorter length would be nice.
I would suggest that for some reason such scenarios are allowed. However, simply because something is allowed does not make it a best practice. If I created the table, and I had no specific reason why the field should be different, then I would create them the same way. It's like cursors, they exist for specific use cases, but they can be used for others where they are not the best choice. Database design involves knowing how to determine the best method, rather than simply relying on something to be possible.
Hlgem source share