Yes, you can use the CHAR column as the primary key in MySQL.
However, you should be aware that your reference numbers are integers and apply leading 0 at the application level.
You may also consider using a surrogate key that is not derived from a reference number or any other application data. The main advantage is that your records will not lose their βdescriptorβ if the order reference number ever changes. You will also get additional integer index performance as a positive side effect.
source share