This is a hackerRank THEPADS problem.
The question is query the number of ocurrences of each occupation in OCCUPATIONS. Sort the occurrences in ascending order, and output them in the following format:
There are a total of 2 doctors.
There are a total of 2 singers.
There are a total of 3 actors.
There are a total of 3 professors.
the occupations table goes like this
CREATE TABLE occupations(name varchar(100),Occupation varchar(100));
so how can i print this format is there any printf like function in mysql
Here is the image of the records present in occupations table:

You can use concat method to append and group by and count function to get number for each occupation
SELECT "There are a total of ", count(OCCUPATION), concat(lower(occupation),"s.") FROM OCCUPATIONS GROUP BY OCCUPATION ORDER BY count(OCCUPATION), OCCUPATION ASC
Just to clarify. There is sucha function and it's SELECT. You can print things like this:
SELECT "Hello world" as "";
or
SELECT "Hello world" as ""\G;
There is no way to remove the : prefix in the second case.