Intermediatesql query Verified
SQL: given Signups(user_id) and Confirmations(user_id, action) where action is 'confirmed' or 'timeout', find each user's confirmation rate rounded to two decimals (users with no requests get 0).
ReportedSource: GeeksforGeeks interview experience: Infosys Specialist Programmer L2 off-campus
Quick answerFree
Signups LEFT JOIN Confirmations, GROUP BY user, ROUND(AVG(CASE WHEN action='confirmed' THEN 1.0 ELSE 0 END), 2); users without requests get 0.
Detailed answer· ~110 words
Interview PrepUnlock the full answer with Interview Prep
Get a ~110-word model answer and a runnable reference solution, plus 247 more SQL questions.
Also in Pro (₹499 / 90 days).
Reference solution· runs in the browser sandbox
Interview PrepUnlock with Interview Prep
+ 247 more SQL questions in Interview Prep, each with the full answer.