I have a table in MySql database with thousands of records. The structure is as below
Here the column "difficulty" has three possible values, which are A, B, and C.
Question is I need to retrieve 10 random rows from the entire table in which 4 rows are of one of difficulty type A, 4 rows are of difficulty type B and the remaining 2 rows of difficulty type C.
I want to achieve this with a single call. I am not good in writing SQL queries and looking for some guidance.
Thanks,