count(distinct device_id) as did_cnt
,COUNT(question_id)
FROM
question_practice_detail
where 
-- Year(date) ='2021' and month(date)= '8'
-- date_format(date,'%Y-%m')= '2021-08'
-- SUBSTRING_INDEX(date,'-',2)= '2021-08'
SUBSTRING(date,1,7)= '2021-08'
-- LEFT(date,7) ='2021-08'