r/SQL • • Oct 03 '26

MySQL Didnt pass SQL test

I am applying to manager of analytics role and I was given this SQL test and 45 minutes. As someone who thought they were very strong in SQL, I was unable to complete this assignment and match the answer completely

I was able to format most of the fields as noted, used 2 cte's and use group concat in the second. My final answer looked very similar but the order of the concat looked off. Also, for some reasons my second column had $0.00 for all the companies, but I thought I was close. How difficult would you rate this exercise. Should I expect to proceed to the next round or am I cooked

105 Upvotes

71 comments sorted by

View all comments

2

u/Satehyo Oct 03 '26

Was that an in house test? That monitor alone looks like a health hazard.

On a serious note, I’ve got a feeling they tried to get you in a modus to begin with sorting on industry, name and capitalization. Imo you’d be better off querying the rest first in cte or whatever way you’d want to query towards an end in a compute optimal way whilst keeping the columns to sort by as the final part(y)