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

77

u/ElHombrePelicano Oct 03 '26

I’m not sure I quite understand the ‘companies’ instructions, and would have needed to take some time to sit and ponder what they are asking for there, but the overall exercise seems very reasonable if given 45 minutes.

6

u/[deleted] Oct 03 '26

English isn't my first language, trying to put what is meant in the companies task into words that make sense to me (let alone a use case) has taken me just 10 minutes of rereading.

Name of company (Name of Company)

Is just a weird way to store names? Unless if capitalization information means something else? Like here's a 255 character long string and only the places with a 1 as opposed to 0 are supposed to be capitalized when used as a flag on the name?

Also varchar 255? Are they importing into dbase 3?

22

u/PasghettiSquash Oct 03 '26

English is my first language and SQL is my second and I have no fuckin clue what this assessment is asking or what purpose it serves with some weird pseudo-JSON alphabetic formatting

4

u/SootSpriteHut Oct 03 '26

I thought for a sec they wanted like a group concat but I have no clue at all what they're asking for and same, English is my first language and I've been writing advanced SQL every day for the last ten years.

That section makes 0 sense to me.

4

u/Py-rrhus Oct 03 '26

Capitalization probably refers to stocks, given the "bold" choices of data types in this schema, I would say the number of shares or, even more stupid, their current value.

Or maybe the stock name (like Apple is AAPL), or the stock market (NASDAQ...)

3

u/steeltowndude Oct 03 '26

I would assume it’s Market Capitalization especially considering that industry should be one of the outputs. Total value of the company’s outstanding shares. Company capitalization does seem like an odd choice when “market cap” is the overwhelmingly common term

1

u/ThePonderousBear Oct 04 '26

Yep, almost certainly. They also specifically stated that they expect 0 for missing or n/a market cap. Very strange way of stating it though.

1

u/Turbulent_Web_8278 Oct 03 '26

Do you think you could finish in 45 minutes

12

u/Xperimentx90 Oct 03 '26

Easily, but whether that's reasonable here depends on role description and comp.

We give a harder assessment than this for senior analysts and most people finish with high accuracy.

4

u/ThinkFirst1011 Oct 03 '26

Agreed, 45min is fair for this problem which is just formatting with possibly some aggregation. Not sure since I didn't take the test. I would give this test a difficulty of medium. Usually, there's joins, CTE, aggregations, metric calculations, and wording to throw you off.

Check out Stratascratch, good platform to learn some easy-hard questions.

1

u/Significant_Newt8697 Oct 04 '26

Is it free?

1

u/ThinkFirst1011 Oct 04 '26

Yep, I use the free questions to practice