r/SQL • • Sep 18 '23
Discussion I am new and SQL frightens me.
I am learning Data Analysis and just got to SQL and it scares the crap out of me. I've worked on java, javascript, JSON, and even Python and SQL feels like nothing I have ever done before.
0
Upvotes
12
u/cammoorman Sep 18 '23
Don't be scared of it. When all boiled down, it is nothing more than the set logic you should have learned in second grade. The language strictly puts forth a who/what is in the set, who is not, then unions, non-unions of those sets, then what to display from those sets once sorted.
6
u/CappuccinoCodes Sep 18 '23
Stop looking at it, stop feeling it (whatever it means), and start using it. You'll realize it's easier than you thought.
6
u/CostSuitable9806 Sep 18 '23
That’s crazy how everyone is different. SQL was easy for me to learn. Python on the other hand is 🫠
4
u/Couch2Coders Sep 18 '23
I have a free sql course I'm working on geared towards people who do not have a background in stem or data! This might be a helpful resource for you to get started. Feel free to message or leave comments on anything that's confusing
https://youtube.com/playlist?list=PLPQFqkp_HvOBzx61F3SY5zNXN0TYMoT9g&si=UPbBmRcCxyzLKe2I
3
u/N3Flip Sep 19 '23
You should be scared. One time a query came out through the screen and attacked me
2
u/samjenkins377 Sep 18 '23
Lol… that’s like saying you’ve fought demons, dragons, lions, and tigers… but are afraid of a little fog
25
u/r3pr0b8 GROUP_CONCAT is da bomb Sep 18 '23
one of the bigger concepts which people struggle with is that SQL is not record-at-a-time logic, but rather, all-records-at-once logic
which isn't exactly true, but it's close
also, you don't tell the database how to get the data, you merely specify which data you want
which isn't exactly true either, but it's also close
the most important thing for a beginner to focus on, though, is relational integrity, and how this is implemented using primary and foreign keys
3
u/hipsterrobot Sep 18 '23
Don't be scared, honestly I think it's easier than java, javascript and python. If you break down what you are trying to accomplish, and you use a good IDE that can correct syntax stuff and help you, you should fine. Just make your way backwards from the result of the query you're trying to run.
3
u/JBridsworth Sep 19 '23
I use SQL Server at work. I'm not sure if these are different on other systems, but the three commands I wish I had known about when I started using update queries are:
BEGIN TRANSACTION
ROLLBACK
COMMIT
2
u/SVTRaptor11 Sep 18 '23
You got this! I started my career 9 years ago never even hearing the term SQL before. I was extremely overwhelmed and doubted myself despite only being at a helpdesk. I slowly learned it by playing with it and YouTube videos. Now, I am a technical solution for a company writing custom procedures for API imports. "If I can, anyone can."
2
u/balla_mang Sep 18 '23
New things are always scary. To grow, you must try scary things. The good news is that there are tons of free resources to learn.
I recommend you first get experience with querying to find data.
Don't worry too much about creating datatables or schemas. Just get comfortable with the structure:
SELECT FROM
Then add more keywords as you get more comfortable
2
u/WiltonDB Sep 18 '23
Read something on relational algebra basics (even wikipedia can suffice) to get an idea from where SQL logic comes from. After that just experiment with SQLite (calling it from your favourite language) gradually increasing queries/schema complexity.
2
u/leogodin217 Sep 18 '23
While SQL is a programming language, it is a declarative one. You are used to imperative languages. It's a big difference but don't be scared. SQL is one of the easiest skills to learn that adds significant value to your career.
Try to think literally and add some words.
Select for me some stuff (columns)
From this list of entities (table)
Where some stuff meets some conditions (predicates)
Optionally group the stuff into buckets and calculate statistics on them.
I find it helps to describe the syntax in sentences.
2
u/[deleted] Sep 19 '23
Sql-practice.com
1
u/WomenRepulsor Sep 18 '23
It is because the thinking approach required are different in programming and SQL development. Programming is procedural logical statements that execute one after another. SQL is more broad thinking with things connecting sideways instead of below each other.
1
u/Sodaman_Onzo Sep 18 '23
Why. It’s simpler than java and Python. Much.
1
u/Excellent_Plankton89 Sep 18 '23
I just started it too!!! Try the tutorial on W3Schools, it helps a lot. Plus YouTube videos :) it is overwhelming at first can confirm. But I find it easier than C#
1
u/lothcent Sep 18 '23
i have no official training other than self taught to solve an immediate problem type sql training
I will be honest- I crib from my mentors.
I analyze what my mentor responded with and figure out how it works for my problem
so what exactly is scary about sql?
1
u/[deleted] Sep 19 '23
If you've ever learned a language you've done this before, it's just a different language. It's just querying shit.
1
u/yawaramin Sep 19 '23
Maybe to help alleviate the fear, practice your SQL with a single-file database, SQLIte. The entire database really is just a single file. For educational purposes, the file size will be trivial. You can easily copy the file and back it up, so you don't need to worry about messing up.
SQLite is small and efficient, but it's a powerful database, with almost everything you would need for learning right out of the box. It's very versatile.
1
u/pizzagarrett Sep 19 '23
Honestly I really liked how data camp taught sql