Generate Unique id based on month and date MYSQL
<p>I am working on a small software for a doctor for his personal use. He wants the Unique id of the patient to be a combination of year, month and number of patient of the month. e.g. for fifth patient in july 2016 id should be 2016-07-05 and when the month changes id should be reset to 1 again. How it can be achieved in mysql db? I can put do it in php code, but i want to do it in the database table and save the lines of code from executing every-time. I searched around but I was unable to find the solution.</p>