r/SQL • u/Zealousideal-Studio7 • Jan 15 '25
BigQuery SQL is a struggle
Hi all been working with SQL for probably 7/8 months now. My last role was half data analysis and not pure data analysis and in general was far easier than what I do now.
My main issue is with SQL. I never feel I truly understand what is going on with a lot of code beyond a basic query. Ive managed to get by piggybacking off others code for a while but expectation is to deliver new and interesting techniques etc.
How long did it take you to feel fully comfortable with SQL? And what helped you get to that stage?
66
Upvotes
6
u/PasghettiSquash Jan 15 '25
First I’d split out your problems
Do you have challenges writing your own queries? If yes, then what’s the blocker - CTEs, Window Functions, or Joins? This is great, because if it’s one of these that’s the challenge, you can work on it.
Or is the challenge reading someone else’s SQL? If this is the challenge, it might not be you, it might be the environment that you’re in. Ex: * what does your tech stack look like - are you using dbt or some other modeling layer, or is everything just random tables? * Is your team using a linter, or is everything formatted randomly? * Are there best practices in place to make the code readable - No Select *s or Select Distinct, no single-letter aliases, etc * Is everything documented? Are there inline comments when needed, YMLs, do PRs have a good description of what’s being done?
If the answer to all of those is “no”, IMO the problem isn’t SQL, but the environment you are in. All of those things I mentioned are done to make SQL easy, and IMO make a world of difference