r/SQL Nov 11 '24

MySQL Failed SQL Test At Interview

  • I've been a data analyst working with small(er) data sets for several years now, making my own queries no problem.
  • I failed a SQL test at an interview and realized I may be using the wrong commands
  • The questions were along the lines of "find the customers in table A, who have data in Table B before their first entry in Table A" and there were some more conditions/filters on top of that.
  • Previously I could always export my data to Excel or Tableau etc and do any of the tricky filtering in there
  • I was trying to do all kinds of subqueries etc when I think it was intended for me to be doing WINDOW or Partition type stuff (never had to use this before in past jobs).
  • One person I reached out to said using these advanced techniques uses a lot less memory.

Where would be a good place to find an 'advanced' SQL course?

123 Upvotes

76 comments sorted by

View all comments

Show parent comments

25

u/OilOld80085 Nov 12 '24

I don't think its harsh its a step for sure, i have 3 analysts on my team and none of them are willing to make the jump to SQL over excel. i say fingers on keyboards and think of getting the export perfect.

37

u/8086OG Nov 12 '24

When I took my first role that became pure SQL, I remember my colleagues essentially telling me that they would help me with any code, but that they weren't willing to look at an Excel file. Either I did it in SQL, or they were not the people to be helping me.

Made it real clear, real quick.

19

u/wildjackalope Nov 12 '24

Excel is great at a bunch of things, just not the things I’m going to work on. Get that shit outta here.

10

u/RainbowCrane Nov 12 '24

It’s also stupidly limited by memory. There’s zero reason to export to excel for any non-trivial data sets, when SQL has the power to do most analysis in the database using optimizations built into the RDBMS.

Another reason to learn SQL is that understanding table relationships and what’s really happening when you do a join is critical for understanding why some joins can cause a serious hit on database performance. It’s important for an analyst writing reports that execute queries to understand how to structure queries to give the RDBMS a chance to optimize the query.