If you want number of all alerts and from that number of C and number of M then
SELECT
user_name,
COUNT(type_alertes) AS nb,
id_user,
SUM(CASE WHEN TYPE ='C' THEN 1 ELSE 0 END) AS critique,
SUM(CASE WHEN TYPE ='M' THEN 1 ELSE 0 END) AS majeur
FROM stat_alert
JOIN user_qdf ON user_qdf.`id` = id_user
GROUP BY id_user, user_name
should do that.
I assume that user_name is from user_qdf table and other are from stat_alert and id_user is not null.
EDIT: For sum of alertes
SELECT
user_name,
COUNT(type_alertes) AS nb,
id_user,
SUM(CASE WHEN TYPE ='C' THEN 1 ELSE 0 END) AS critique,
SUM(CASE WHEN TYPE ='M' THEN 1 ELSE 0 END) AS majeur
SUM(CASE WHEN TYPE ='M' OR TYPE = 'C' THEN 1 ELSE 0 END) AS both_c_and_m
FROM stat_alert
JOIN user_qdf ON user_qdf.`id` = id_user
GROUP BY id_user, user_name
EDIT2:
SELECT
user_name,
COUNT(type_alertes) AS nb,
SUM(CASE WHEN TYPE ='C' THEN type_alertes ELSE 0 END) AS critique_alerts,
SUM(CASE WHEN TYPE ='M' THEN type_alertes ELSE 0 END) AS majeur_alertes
id_user,
SUM(CASE WHEN TYPE ='C' THEN 1 ELSE 0 END) AS critique,
SUM(CASE WHEN TYPE ='M' THEN 1 ELSE 0 END) AS majeur
FROM stat_alert
JOIN user_qdf ON user_qdf.`id` = id_user
WHERE TYPE in ('C','M')
GROUP BY id_user, user_name
is that what you want?