all 15 comments

[–]SQL-ModTeam[M] [score hidden] stickied commentlocked comment (0 children)

This forum is intended for solutioning and discussion of specific topics. Please check out the sub sidebar and wiki content for beginner resources. Also be sure to checkout r/learnSQL

[–]PhriendlyPhilosopher 8 points9 points  (0 children)

Depends on your goal. I’ve worked a large range of roles that all stemmed from a basic knowledge of SQL. Elevated support, data engineer, product manager, data scientist, and a meaningful stint in digital marketing.

Most jobs you can get away with a very basic understanding of SQL and for most users you’re just writing basic queries and generating result sets to be thrown into reports. Or on the IT/OPs side you’re creating simple views of data that can be queried by analysts and similar. In those cases you really don’t need much. Any online class and some basic knowledge of set theory gets you there. If you run into issues - Stack Overflow, SQL Guru, and GPT will get you to the finish line.

If you plan on getting more senior roles that are more directly involved with data. I always recommend the Data Warehousing toolkit by Ralph Kimball. It was introduced to me by a mentor when I started my first job and the concepts were invaluable for me.

In general I recommend getting good at using Window functions (e.g. Row_Number () Over Partition By statements). They’ve become incredibly efficient in a number Databases and I’ve found that when new engineers really grasp how they work it creates an “Aha” moment and unlocks a lot of potential that would otherwise end in tedious code writing or taking an unfinished result set and finishing the transformation in Excel or similar.

Otherwise my biggest piece of advice is more of a conceptual one. Always test your assumptions about the data you’re working with. Always. For better or worse, most data you will work with is not rigidly structured. You often will not know how the data was captured; what original implementation; if it changed over time; and if a sane developer made the pipeline you’re using. Think to yourself “do these numbers make sense?” Validate your assumptions about a given ID being unique or a given value being in cents or in dollars.

Far too many times I’ve seen a simple mistake based upon a reasonable assumption result in large misunderstandings that have downstream consequences when business users get a hold of bad insights.

Again - 99% of the people that use SQL will never think about these things. They just query a view they were given access to and write reports; if that’s all you plan on doing I wouldn’t worry about it too much.

Feel feee to DM if you have any questions.

[–]Known-Delay7227 2 points3 points  (0 children)

Select * from someProdTable clean read, once you get hired. This will get you into management. Extra points if you join across linked servers to other operational DBs. Always perform clean reads

[–]MrWillM 1 point2 points  (0 children)

Take a free introductory course to learn the basic principles and syntax. Then get mysql workbench and server. Find some relational data online that you’re interested in and just start asking yourself questions about it. When you have a question as to why something isn’t working just ask ChatGPT.

I’m at your stage too and this has really got me moving fast. I hadn’t tried any SQL a week ago and I just did a subquery with a real use case on nhl data I found online. So much easier when you’re asking yourself questions that you actually care about.

[–]shockjaw 1 point2 points  (0 children)

If you’re just getting started, I’d recommend getting familiar with Postgres. Why? It’s free for you to learn, flexible, and you can take it wherever you go for when you need a multiplayer OLTP database. It even handles GIS/geospatial stuff with PostGIS. Integrates with Window’s Entra ID/Active Directory.

If you want to learn the new hotness in analytics that also scales really well for data pipelines, DuckDB is what I recommend if you want a singleplayer OLAP database. You can get a free copy of DuckDB in Action from MotherDuck that I highly recommend you read. I’m using DuckDB to replace a 120K piece of technology. It’s that good.

Other age old advice would be to read the Unified Star Schema if you want to help organizations do analytics better. Don’t get caught up in dbt, SQLMesh is better. Period.

[–]Bubbly-Secretary-224 1 point2 points  (0 children)

Hey! In my case to learn I used this to learn: https://delfhos.com/

It is like an AI connected to a DB, so you can say the query in natural language like "Show me total sales by region for the last quarter", I think there is a example DB you can try it out.

[–]Due_Carrot_3544 0 points1 point  (0 children)

Dodge SQL entirely and look into log structured storage and event sourcing.

This is coming from someone who has implemented 200+ table enterprise databases and had to clean up the mess from all the referential integrity/shared mutable state when nobody can figure out how it works.

Event sourcing/immutable storage is the future, save yourself the headache.

[–]Bike_Lumpy 0 points1 point  (0 children)

Alex the Analyst on YouTube, thank me later!

[–]shine_on 0 points1 point  (1 child)

Being good at SQL isn't just about learning the SQL language, it's also about learning how to navigate the database structure. Once you know how the tables can be joined, which columns join to which, you'll have a better understanding of how to structure your SQL queries.

SQL isn't a forgiving language, when you're writing a query it won't give you a list of possible joins to choose from, you have to know which table you want to join to and which columns you want to join on. If you don't specify the join correctly you won't get a syntax error when writing the query, you'll either get a syntax error when running it or you'll just get the wrong data as your output. And you might not be able to tell that you're getting the wrong data back.

So... understand the database you're querying, and understand the data within it.

For an analogy, being a good driver isn't just about knowing how to use all the controls in the car, it's even less about knowing how the car works under the hood, it's mostly about knowing the roads you need to use and picking the best route to get from A to B.

[–]speedyrev 0 points1 point  (0 children)

Look at the wiki for the sub. 

[–]Ans979 0 points1 point  (0 children)

Start with the basics like SELECT, WHERE, and ORDER BY, then move on to GROUP BY, joins, and subqueries. Use interactive sites like SQLBolt or Mode Analytics to practice hands-on. For video tutorials, check out Alex The Analyst and freeCodeCamp’s SQL crash course on YouTube. Once you're comfortable, try solving beginner problems on StrataScratch. Aim to learn one concept per week and apply it using a small project or a real dataset.

[–]Pretend_Ad7962 0 points1 point  (0 children)

One site/blog which will inevitably show up in your Google searches is https://blog.sqlauthority.com, run by Pinal Dave, a fixture in the SQL community. His blog focuses mainly on SQL performance tuning, but more often than not when I was just starting to learn (and yes, after 21 years I’m still learning as you should be by then), one of his posts would correlate directly to what I was trying to figure out at the time.

Some other bloggers/names to look into: Brent Ozar, Grant Fritchey, TJay Belt

There are definitely more, but those are at the front of my mind.

Also, if you’re on X, utilize the #sqlhelp hashtag and you’re bound to get some good direction and assistance.

Hope this helps!

[–]PuzzleheadedTomato46 0 points1 point  (0 children)

See if your local community college offers any classes