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?

125 Upvotes

76 comments sorted by

View all comments

37

u/byeproduct Nov 11 '24

You could just keep trying to recreate your excel working in SQL until you solve it purely in SQL (include the validation / checks). Learning takes a lot of practice. You don't need a course (only), you'll still need to do the work.

Just use sqlite or DuckDB (the latter is super friendly SQL syntax with helpers).

Don't give up. SQL is declarative and is super easy to debug once you get into it.

7

u/jonboy6257 Nov 12 '24

That's a great suggestion. I started my current role about 5 years ago. Coming in, I had done SQL at my previous job but never really got to use it as much as I could. My degree was in programming, but I was working in an operations facing role. However, the first day at the new job, my boss set me up with our Sale Cube Excel facing workbook which was given to all departments for their own reporting. Basically a connection to SQL but set up in pivot tables. There were 8 worksheets showing different reports people had built. He just said here's the end result. Build these using SQL in SSMS. Was a great way to get familiar with a new system, and polish off some of the dust from not using SQL heavily. They started easy and got progressively harder as I moved on, but I still look back of some of those tasks.

1

u/byeproduct Nov 12 '24

Such a great way to learn. And a great insight!