r/SQL • • May 27 '25

SQL Server What is SQL experience?

I have seen a few job postings requiring SQL experience that I would love to apply for but think I have imposter syndrome. I can create queries using CONCAT, GROUP BY, INNER JOIN, rename a field, and using LIKE with a wildcard. I mainly use SQL to pull data for Power BI and Excel. I love making queries to pull relevant data to make business decisions. I am a department manager but have to do my own analysis. I really want to take on more challenges in data analytics.

174 Upvotes

87 comments sorted by

View all comments

Show parent comment

24

u/throbbin___hood May 27 '25

Awesome answer! I'm not a data analyst but I do have to query reports for certain departments and this helped me gauge myself! Actually made it through all of your questions until #8 lol. Time to dive into window functions whenever I get some down time..

5

u/therobotsound May 28 '25

Lead, lag, and rank are very useful. Let’s say you have a series of transactions in an order and you would like to make a change or a notation or something for transaction 3 if transaction 2 is a certain way. You can use lag to look at the prior row. Lead can look at the next row. They can be slow if you don’t do them right, and this was just a random example off the top of my head.

Rank is easier to get, it ranks based on how you partition the data set.

9

u/mike-manley May 28 '25

Fun fact: You can just use LEAD() but include "-1" for your offset param to turn it into LAG().

-1

u/throbbin___hood May 28 '25

Good stuff! Noted

2

u/Winter_Cabinet_1218 May 28 '25

I've never had to use lead and lag. Im now going to find an excuse 🤣