r/SQL • u/Effective_Ocelot_445 • Jun 15 '26
MySQL What SQL concept became much more important once you started working in data engineering?
Iam curious which SQL skills or concepts turned out to be the most valuable in real world data engineering projects compared to what is usually taught in courses.
48
Upvotes
39
u/Aggressive_Ad_5454 Jun 16 '26
Indexing. Loose index scans. Skip-scans. https://use-the-index-luke.com/
20
u/xodusprime Jun 16 '26
Reading execution plans and understanding what they are actually telling me about how the query is interacting with the underlying structure.
14
u/spddemonvr4 Jun 16 '26
Window functions save a lot of time when creating complex data sets.
And surpringly so does coaescle!
12
u/more_paul Jun 16 '26
No SQL course is ever going to teach you how to scale queries to large datasets. I've been downvoted into oblivion for suggesting that it is important to learn how to write efficient queries from the outset that don't need significant optimization. It's not even that hard, but it takes some curiosity to read execution plans, try things out, and figure out what works best. Eventually you should be able to recognize all the "optimization" steps you need to take at the beginning to write a query that takes 10 minutes to run on terabytes of data instead of 3 hours. The downside to all this is no one in management will ever care to recognize that you save them hundreds of thousands of dollars in AWS bills a year by doing this.
9
u/Large_Hedgehog2416 Jun 16 '26
A simple one, but generating global temp stored procedures on production in order to test preformance tuning of existing SPs, as our own performance team are slow and their environment data size and traffic is nothing like production. (Reads only btw).
8
u/DaOgDuneamouse Jun 16 '26
For me, the biggest is date math. Seeing if two things were true at the same time and making sure stuff is happening in the mandated amount of time.
The other big one is string manipulation. Formatting stuff into strings or mining stuff from strings.
4
u/jmelloy Jun 16 '26
Grain, first getting it right and then how to join tables of different grains.
3
u/belemiruk Jun 17 '26
Window functions and query optimization (especially understanding execution plans) became absolute game changers. In courses, you usually write queries for tiny datasets where everything runs instantly, but real world data engineering forces you to care about partition pruning, indexing, and reducing data shuffles.
Writing a query that works is the bare minimum; making it scalable and cost efficient on terabytes of data is where the real data engineering begins.
3
u/scarlett_data Jun 18 '26
Database designs, I have been working with SQL for over a decade and bad design really has implications on how you query tables
1
u/Predicate_12 Jun 17 '26
Not really data engineering, but in risk analysis/fraud strategy, window functions are pretty huge. Low hanging fruit I suppose haha. Also learning how to properly communicate your findings and support your controls/strategies with executives that only really care about client impact is extremely important.
1
u/CuritibaDataScience Jun 17 '26
Not SQL per se, and sorry to deviate on the answer, but dimensional modelling (the gold and old Kimball concept) is one of the concepts that I find the most important and useful.
1
u/PTcrewser Jun 17 '26
INSERT
DELETE
1
u/jondonessa Jun 17 '26
Database statistics (about tables view etc) they effect how your queries will be executed and stale statistics can cause much worse execution plans
1
u/Euphoric-Jello2261 Jun 17 '26
Finding how to join external datasources(public ones) while having a bad source system. Cleaning our internal source system, cleaning the public dataset and then elaborating a strategy to reduce data duplication and then deduplicate. This gets harder if the key you have to use allows duplicates on both sides
1
u/KatFromSisense Jun 19 '26
NULL handling. Courses often treat it like a small syntax detail. In production, it can completely change who gets counted, or whether the number on the dashboard lines up with the one finance is using.
I've had rows disappear because the account ID was blank, so the table match simply left them out. In another place, those records were kept and grouped under unknown. Both reports were pulling from the same place, but the totals still came out differently.
These days, I compare the row count before and after I combine tables. Then I take a quick look at where the empty values landed. It doesn't take long and it catches a lot of weird edge cases. The bigger fix is deciding once how blanks should be treated and using that rule everywhere.
1
u/chocolateAbuser Jul 02 '26
lots of stuff, like still reading the manual because sometimes db does this but it doesn't do that and not always i remember exceptions, then for sure looking at the big picture of the whole project because looking details will never solve some issues, and then the engineering part, so trying stuff, using temp tables, benchmarking before consolidating a design, and so on
61
u/[deleted] Jun 15 '26
[removed] — view removed comment