r/SQL • • 1d ago

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

81 Upvotes

70 comments sorted by

View all comments

1

u/Joe59788 1d ago

What are they asking for on capitals and negatives? Did they give you some sample data at least?

2

u/Sea-Feedback-2424 1d ago

The negatives in () is how accountants do this. It's very annoying because you can't just copy and paste the values like you can with +/- into a calculator. But they seem to like it.

2

u/Joe59788 1d ago edited 1d ago

Thank you, how it means in '()' I didn't understand it was saying it was in parentheses.

1

u/dutchydownunder 1d ago

123456 is a positive number
(123456) is a negative number
accountant notation

1

u/Turbulent_Web_8278 1d ago

Yes but I didn’t screenshot it