I’m creating a database so that I can access names of people from a university. But I would like to create a registration ID for each person (like 1012607) of which the first 2 numbers would be the year (11 for 2011) and the third digit would be the semester they registered (1 in the beginning of the year and 2 in the end of the year).
The other 4 digits would be incremental. I don’t know how to code a prefixed number in MySQL that can change only the last 4 digits and after a year change the first 2 digits every time you have a new registration. Can someone please help me?
I would suggest you have a table design like the following:
then when reporting on it use the logic you mentioned above. Doesn’t have to be that complicated.