Getting count and percentage of valid and invalid records, group by day
SELECT user_id, 
       DATE(created_at) created_at, 
       SUM(valid=1) valid, 
       100*SUM(valid=1)/COUNT(*) pvalid, 
       SUM(valid=0) invalid, 
       100*SUM(valid=0)/COUNT(*) pinvalid
FROM test
GROUP BY user_id, DATE(created_at)
ORDER BY user_id, DATE(created_at);


fiddle