Conditional logic & CASE
Exercise · SQL & Querying

Predict, then run it

Predict the output

att(member, kind) = (Ada,workshop),(Ada,dropin),(Ben,dropin). Count each member's workshop sessions only:

SELECT member, COUNT(CASE WHEN kind = 'workshop' THEN 1 END) AS workshops FROM att GROUP BY member ORDER BY member;

Predict the exact output.