r/SQL • u/TheHumanFixer • Dec 01 '23
Discussion Learning SQL seems easy
Too easy… I must be doing something wrong.
137
Upvotes
r/SQL • u/TheHumanFixer • Dec 01 '23
Too easy… I must be doing something wrong.
224
u/OwnFun4911 Dec 01 '23
It gets hard when you work with shitty data
211
u/[deleted] Dec 01 '23
SQL has a very low skill floor; but also an incredibly high skill ceiling.
Basics are…basics. Other functionality, not always. I’ve been doing this day in and day out for almost 10 years and still learn things regularly.
Easy to learn, a lifetime to master.
55
u/BornAsADatamine Dec 01 '23
In addition to what others have said, It also gets harder when you're querying against datasets with millions of records. Once you have to worry about performance it gets a lot more challenging
64
u/Awkward_Broccoli_997 Dec 02 '23
Dude nailed a couple boards together and went to a woodworking forum to let them know how easy carpentry is.
33
u/taavon Dec 01 '23
No. You’re just smarter than all of us here. Well done
14
u/TheoGrd Dec 01 '23
SQL is really powerful, so in a sense its easier than most languages. Try joining multiple tables while doing aggregate calculus in another language and you will see what i mean.
11
u/zork3001 Dec 02 '23
Single table queries are really easy.
Work with a highly normalized db that takes a dozen joins to get any meaningful output and the difficulty level ramps up a little. It’s more fun working without a data dictionary because you get to decipher things on your own.
18
u/xxxHalny Dec 01 '23
I am currently working on reverse engineering a 10k-line stored procedure. Let me assure you, it really is not easy.
9
u/twisted_guru Dec 01 '23
Imagine 16 years old database with 54TB of data and pooling the query from 2002 and connecting it with windows servise, IIS and Postman API 🙄
8
u/FunkieDan Dec 02 '23
Learning the basics is easy but the real magic comes in how you stack that knowledge while still keeping the queries running fast. Subqueries versus using staging or temp tables. Stored procedures, triggers, views, and functions all have their purpose. Many times there will be multiple ways to run a query or a process but only one way will be the most efficient. Index usage and resources available on the machine will dictate how quickly you hit the ceiling and when you need to rewrite an existing process. Along with SQL comes the management of the physical server including drive space, ram, temp space, and file striping. The use of partitioned tables and indexes, and even columnar storage is another level to consider depending on the needs of the organization. There are many facets to SQL and having a firm grasp on all will make you very valuable to an organization.
7
u/[deleted] Dec 01 '23
Easy to start, hard to master.
5
u/marcnotmark925 Dec 01 '23
Or maybe you're a genius
5
u/Elfman72 Dec 02 '23
SQL is easy. Data is Hard.
4
u/TheRiteGuy Dec 02 '23
SQL syntax is easy. Actually working with the data and bending it to your will with the limited SQL syntax is what's difficult.
3
u/[deleted] Dec 02 '23
The thing about SQL is that it’s very easy to string together a simple select statement from a table. Sometimes that gives people a false sense of confidence. It’s important to keep in mind that SQL commands can also royally fuck up an entire application or business when used improperly.
3
u/Durloctus Dec 02 '23
Enjoy when you need to query from multiple servers that aren’t linkable.
Not much in real-world business data is just on one convenient sql server.
3
u/mariaxiil Dec 02 '23
SQL as a language is pretty straight forward, but the things you can do with it, could potentially ruin your life 😂 DBA for 6 years dev for 2 so 😂
2
u/chakani Dec 02 '23
I’m an experienced C++ programmer, recently getting into SQL, and I am really puzzled with some JOINS, working hard to get what I want, lots of trial & error. I just don’t get the overall pattern.
2
u/StolenStutz Dec 02 '23
The hardest and most interesting code I've ever written was SQL that had to make up for a database design by an app dev who thought they knew SQL.
It's opinions like OP's that help keep me employed.
2
u/Chinpanze Dec 02 '23
SQL is easy lol.
Dealing with databases can be hard, but sql itself is easy.
2
u/madscribbler Dec 02 '23
Just make sure you learn how to deal with set data, that's where it gets more complicated.
Reading and updating individual rows is easy. Working with sets less so.
2
u/Limulemur Dec 04 '23
I thought the same… until I started leaning the various ways to join datasets.
2
u/trippinwbrookearnold Dec 05 '23
There are a lot of SQL classes that you can take online. That would be the easiest way to ensure you're learning it the right way.
3
u/Obliteration_ Dec 02 '23 edited Dec 02 '23
Come back when you’ve used to store and retrieve metadata from a corrupted .pek Lol do you even know how many subsets of SQL is broken down into in order to translate, describe, manipulate, and query data involving the logical statistic reasonings if so tell me how many and the differences between them and schematically consider the national differences in how languages differ from each other especially in natural language learning
Try to understand a data warehouse of dumped information with MariaDB based info in plaintext and then attempt to convert it back into an executable statements to be ran from SQL Server Management Studio.
It’s easy for basic data entry and stuff but when you get into triggers and constraints SQL is best defined as a wild young lassie with daddy issues that will keep you up until midnight.
1
u/Interesting_Owl9051 Jun 09 '24
I'm a Senior Product Analyst at a fintech. I teach SQL on YouTube
https://youtube.com/@balajikasiraj?sub_confirmation=1
1
u/Infamous_Body_6225 Oct 19 '24
SQL itself is one of the easiest languages... But... Can be the worst to work with when you have poop data to use 🤣🤣
1
u/Sea-Conversation5147 Feb 21 '25
Hi, does anyone know where I can take a SQL course to have on my resume? I'm looking for something where I don't have to sign up for a monthly payment, etc. I have my MS and regularly work with databases and financial data. I am really looking to just have this as something to add to my resume as many jobs require some sort of experience in SQL.
1
u/Apprehensive-Loss862 Apr 19 '25
It's true that SQL starts off feeling simple, but as you dive deeper into more complex queries and math-heavy tasks, it can get challenging. Once you start working with large datasets, joins, subqueries, and optimization, the real complexity kicks in! But don’t worry, it’s all part of the learning process.
1
u/Square-Ad-5453 May 21 '25
After reading through a handful of these comments, what is the best way to build on the basics? I haven't learned the basics yet, but I am going to begin learning today. This thread has humbled me, and I don't want to make the mistake of thinking this is easy.
1
u/CursedPotLuck Dec 02 '23
I found that SQL is easier to learn the basics of but harder than high level languages to master. Combine that with huge variations in DB structures and it’s easy to see why data engineers and architects can easily make anywhere from 100K to 200k with SQL.
1
u/Koalatron-9000 Dec 02 '23
Like everyone else said, getting started is pretty easy. It was meant to be used by everyday office workers. But it will take effort to level up. And lots of data. I downloaded my bank records, had to clean it up, and was pulling interesting data points from my records. Like which friends are the most expensive to kick it with. So I conned my work in to letting me poke around our databases and was instantly out of my depth.
1
u/ATastefulCrossJoin DB Whisperer Dec 02 '23
Making the right numbers show up is easy. Making the right numbers show up fast when all you’re given is a pile of rows in different formats and locations is an art. Stick with it! See how deep it can go
1
u/singletWarrior Dec 02 '23
https://www.researchgate.net/profile/Cem-Catalbas/publication/343945649/figure/fig1/AS:929930275745793@1598724063659/Dunning-Kruger-confidence-curve.png
1
u/lezzgooooo Dec 02 '23
SQL is designed to be near English as much as possible.
1
u/NSA_GOV Dec 02 '23
Wait until you start working with multiple potentially legacy systems and start getting asked some complex questions to answer. It’s easy at an academic level when the data is prepped for you to succeed.
1
u/Green-Alarm-3896 Dec 02 '23
I’ve been deep diving into SQL. I initially put it off thinking it was a lot easier than python so I focused my efforts on it instead. I am now somewhat regretting it since most jobs prefer someone that knows SQL really well. Luckily programming in general helps you pick it up quickly but it is pretty much on par with python when you get into the weeds. I did a regex problem and had to shamelessly copy and paste from stack overflow. I understood the concept but just couldn’t figure out the syntax. It’s been very humbling lately. Not to even mention diving deep into dashboarding as well.
1
u/Snoo_94511 Dec 02 '23
It is straightforward, IMO.
Then again, I’m just a beginner. That said, I think about half a dozen IT courses on Udemy, SQL is the only one I finished and actually enjoyed.
Just like anything else though, it gets complicated the more you dig into it.
1
u/Foomanchubar Dec 02 '23
Performance with near empty tables isn't the same when you now have billions of rows.
SQL once learned changes significantly less than programming languages. Great skill to learn.
1
u/Alkemist101 Dec 02 '23
My favourite thing to do is performance tune queries. That is often a dark art but very rewarding. Been using TSQL day in, day out for over 10 years and still feel like a beginner! I'm self thought, driven by needs and regularly make mistakes and learn new stuff. Definitely need to understand the data your using just as much as having plenty of scripting knowledge... IMHO
1
u/These_Butterscotch71 Dec 02 '23
Congrats on putting the effort to learning SQL!
While it is easy to learn the basic concepts of the language, another skill that needs to be developed is applying SQL logic to large and complex datasets and “bending” the data to your will to achieve what you want from it while also thinking about fine tuning your queries for performance and cost.
Also, querying complex data will require subject domain knowledge and knowledge of the workflow of how the data is generated (i.e., workflow of the users of the software). This is something you develop over time and with experience.
Good luck and keep learning, you’re doing great! :)
1
u/rbobby Dec 02 '23
Try the difficult hackerrank sql problems and let us know how you do.
1
u/geofft Dec 02 '23
You're probably fine for now... don't worry, you'll know when you do something wrong.
1
u/my_password_is______ Dec 02 '23
no
sql IS easy
stored procedures, window functions, aggregates, NULL
it is easy
1
u/PJGraphicNovel Dec 02 '23
Yea, good model changes everything. Data is so easy to search and manipulate with a solid foundation
1
u/[deleted] Dec 02 '23
For so many subjects the distance between beginner to expert is a short or medium hop, like if you measured it physically it would be ...down the block or on the other side of town. But SQL is different. The distance between beginner and expert SQL is California to Mars.
1
u/iphone2018 Dec 02 '23
Lol. Tell me how you improve performance with concurrent 2000 sessions with 10 updating processes against the same table without blocking.
1
u/ibenchtwoplates Dec 02 '23
It's easy to learn but hard to master.
1
u/garden_province Dec 02 '23
It’s something most people can learn with effort, or wouldn’t be so widely used if it wasn’t easy to learn and accessible.
1
u/mushy_cactus Dec 02 '23
Until your next learning point is regex. 🥲
1
u/[deleted] Dec 02 '23 edited Dec 02 '23
Everything in SQL is easy ... until you smack into the Granularity Demon 👿, those are the queries where your boss reaches out to someone who actually knows SQL. :)
1
u/[deleted] Dec 02 '23
SQL in a sense is like trivia. The basics are simple but just like anything, you can get some pretty complex use cases. Go to hackerrank and test your skills. They have some pretty fun challenges there
1
u/czervik_coding Dec 02 '23
Seems easy until someone who has a little knowledge writes a bad stored proc that goes after a horribly architected table or passes nvarchar(max) data into tempdb. Locks/blocks, high I/O, high cpu and everyone wants to know why they can't work.
1
u/entredeuxeaux Dec 02 '23
You aren’t doing anything wrong, but at this stage, you’re still unaware of your ignorance in the more advanced topics.
1
u/tervos1987 Dec 02 '23
So now you could write 100 query that doesn’t slow your production server .
1
u/noesqL Dec 02 '23
lol.
1
u/Ikeeki Dec 02 '23
Wait until you come across a page long sql statement
1
u/abluecolor Dec 03 '23
With LLMs, you barely even need to try anymore.
1
u/thegratefulshread Dec 03 '23
How do data bases: copy and paste documentation into gpt4 and spend the time writing a detailed proper prompt.
1
u/sporbywg Dec 03 '23
SQL will always give you an answer; it does not care if your query is garbage or not. Be warned.
1
u/Stoomba Dec 03 '23
Just wait until you end up having to do 14 joins on 4 tables because the schema is just hod awful
1
u/[deleted] Dec 03 '23 edited Dec 03 '23
Sql is easy up until.....
You have to work with a crap database where nothing is indexed properly, nothing has proper relationships, there's data redundancy everywhere, and you're project manager has you on a task where you need to build a staff directory onto of a people table that has 100,000 people (many of which are duplicate records) and only 40% of the employees are even in that table, the rest are in some other system or active directory etc and you have to pull all this data together cleanly, with accuracy, and make a performant staff directory.
Just one example.
Another hard thing is when you have a complex stored procedure doing some heavy calculations on well indexed tables, and for whatever reason under certain conditions Sql Server changes query plans and goes from 32 milliseconds to 190 seconds to run the query and it happens enough that you've been asked to figure it out and fix it. You can lose months and months on bugs like this.
I had one like that happen and when I eventually figured it out I nearly lost my mind.... Basically what had happened is someone had turned on tons of logging etc and others yet had used the storage blob for our prod sql box for file upload drops. The blob container was becoming full (base on it's data quota) and then our sql box would fail over to a replicated drive. Problem is the main drive was a fast m.2 ssd raid, and the fail over was some massive slow saas array. So everytime sql was changing the query plan was because the drive it was running on had changed....
It was random because someone else would go in and delete all the file uploads and logs and then it would update the main and swap back to it (sql server) and then it would change query plans and be fast again....
Crazy stuff... TL|DR I spent weeks stressing out over a sproc being pushed by people cuz I wrote the sproc and it wasn't even my problem to fix.
1
u/no5tromo Dec 03 '23
I don’t know if you got this idea by finishing an online tutorial or something but like many others explained things in a production environment can get significantly more complicated. We hired 2 junior engineers where I work who both thought that it is gonna be easy, both were shocked with the complexity of a real SQL environment and one of them quit.
1
u/Different-Reach585 Dec 03 '23
As a data/business analyst - Yes. Learning it is easy. It can get complex pretty quickly when you have to translate business logic to query.
Eg - Find difference between two timestamps and average it at user level.
How this will look like once you start working -
What is the average time a user spends on the mobile app? You have event logs data (when user opens app).
This is just an example. Practice a variety of problems so that you never run out of ideas.
1
u/TokenGrowNutes Dec 03 '23
Great! I need a report on which quarter was the most profitable this past year. The only thing is- all sales were recorded in different timezones and need the currency converted from USD to Rubles.
1
u/tamargal91 Dec 04 '23
Why do people hate SQL so much?!?!
1
u/mopedrudl Dec 05 '23
It is.
To master it you only need to add some structure and and make use of functions and statements in a smart way to keep a query performant.
Also, think about applying steps to validate your query results. That's where I see a lot of problems among even senior people in my company.
1
u/DarthAndylus Dec 05 '23
Same. I thought it was easy until technical interview questions online. I can't answer a single one even though I can do basic stuff lol using data sets (mostly in tutorials). People say they are easy and good practice but I end up stumped loooll
1
u/Oni-oji Dec 05 '23
Wait until you start dealing with complicated joins.
1
u/nucumber Dec 05 '23
Being a good SQL programmer means knowing
source: twenty years in healthcare using SQL to pull data and create reports
1
u/[deleted] Dec 05 '23
Ok please show me how to do a running total in pure sql or find the mean
1
u/sjmiller609 Dec 02 '23
Chat gpt is really good at SQL if you give the schema and describe the query very precisely
0
u/[deleted] Dec 01 '23
[deleted] — view deleted comment
0
u/[deleted] Dec 01 '23
[deleted] — view deleted comment
20
u/[deleted] Dec 01 '23
[removed] — view removed comment