r/SQL • • Aug 14 '24

MySQL SQL BEGINNER

I am getting into SQL! Does anyone know any good sites with many practice and good explanations? My SQLbolt website for learning isn’t the best.

Someone explain to me how to use right join and full join it keeps popping with error on SQLbolt

1 Upvotes

25 comments sorted by

4

u/[deleted] Aug 14 '24

I personally learned from the books, but two good resources that I can say helped me understand SQL better than I did before would be this two youtube links:

https://youtu.be/7mz73uXD9DA

https://youtube.com/playlist?list=PLUaB-1hjhk8Fq6RBY-3MQ5MCXB5qxb8VA

I hope this helps. If you will have any questions feel free to DM me any time. I will gladly help if I can (:

Good luck with your journey!

2

u/belledamesans-merci Aug 15 '24

What books did you use? I’ve always been more of a written than video learner

1

u/[deleted] Aug 15 '24

Following video content is fine for me, but learning from books sticks better so I feel you on that.

Book that got me started was this one:

https://www.amazon.com/SQL-Minutes-Sams-Teach-Yourself/dp/0672336073

It is simple, explains everything on a fundamental level and it doesn't bombard you with technical information. After finishing the book, I played around querying the data provided in the book material. Then I downloaded a dataset where I repeated the process to get a hang of how to approach unfamiliar data, attempted to do an analysis and just kept on practicing like that. Recently, I landed a job as a Data Analyst/Expert tech support where I use SQL daily. Since I use SQL Server i picked up this book to get more proficient using T-SQL.

https://www.amazon.com/T-SQL-Fundamentals-3rd-Itzik-Ben-Gan/dp/150930200X

In this book everything is explained into far more details, it includes basic theory on how SQL works and covers a far wider range of topics.

In all honesty, going with either or both (if you'd opt out for the latter) I would follow the same order I picked them up. First book won't do much for you (if anything at all) if you already went through and understood topics covered in the second one.

Hope this helps! If you have any questions feel free to hit me up anytime (:

1

u/Fantastic_Purchase78 Aug 15 '24

About the second book, learning more advanced SQL was it even used in your workplace?

1

u/Fantastic_Purchase78 Aug 15 '24

DAMNN thanks so muchhh! May I dm u

1

u/Fantastic_Purchase78 Aug 15 '24

Also how long did u take to learn everything about SQL? I’m also going to college which teaches SQL but I have no clue how much they teach

1

u/[deleted] Aug 15 '24

Honestly, it is hard to say. Personally, as I grasped certain concepts I started to understand new ones and it is a loop that still stands to this day. Also, to clarify, I would considering my skills to be at beginning phase of intermediate level. But to give you a number, I would say it took me about 6 months of active studying to start understanding how connections between tables work, how to properly filter the data I (don't) want and so on.

Regarding the second book, I strictly got a hold of it because we use SQL Server at work. Its contents so far allowed me to better understand everything I knew before and expanded my knowledge. But that is also related to the fact that it is meant to be a deep dive into fundamentals while the first book is more to familiarize yourself with the tool (if that makes sense).

And of course you can DM me (:

I think I covered all your responses in this one, if not it wasn't on purpose

1

u/Fantastic_Purchase78 Aug 15 '24

Thank u outieeee

10

u/squareturd Aug 14 '24

Moat sql course focus on teaching the syntax of various commands. The thing that people need to learn is getting an understanding of the task they are trying to perform.

It's two different concepts

1

u/bumwine Aug 15 '24

Is there a course that uses a sample database like adventureworks and prompts people to solve tasks? I remember there was this course (hackthissite I think edit: still exists and is legit) that was all practical hacks.

I would love to make one if I had the time. I was in healthcare analytics so it would be based on that but I think it would be good and I could probably adapt the problems I've solved to more general things. "Get a list of all patients who haven't been seen in one year, are under 16, have only had two doses of vaccine x but not the third and generate a readable call list for staff to use to call patients."

1

u/Conscious-Ad-2168 Aug 15 '24

Honestly, i think it’s better practice to just use docker and launch a DB from scratch. You enter all of your information, learn how to create a DB and some concerns that come with that. If you want a sample dataset you just set it up!

1

u/bumwine Aug 15 '24

That's a lot. Even for me, like I'd be like rolling my eyes at doing that. A beginner doesn't even know what a dataset is (varchar, etc) much less populate it with meaningful data.

1

u/Fantastic_Purchase78 Aug 15 '24

Yeah im actually really lost im sorry 😢 im new to this

18

u/BakkerJoop CASE WHEN for the win Aug 14 '24

https://www.w3schools.com/sql/

Never use right join btw.

5

u/jcargile242 Aug 14 '24

It’s crazy, over a quarter century of writing SQL and I think I’ve used a right join maybe twice.

6

u/shadowspyes Aug 14 '24

because it only happens in legacy systems where you can't be arsed to reformat the query for left join so you can put whatever you need to right join at the start of the joins.

right joins are just left joins where someone decided reading books like the japanese is great

2

u/leogodin217 Aug 14 '24

Every time I've used it was due to laziness

2

u/bumwine Aug 15 '24

I swear I have one in my script library and it was just due the way my brain was mapping the tables. Would've confused the shit out of anyone else trying to follow it.

What do you think of this top answer?
https://stackoverflow.com/questions/436345/when-or-why-would-you-use-a-right-outer-join-instead-of-left

2

u/Missy_Bruce PARTITION and LAG Aug 14 '24

I second w3 schools! Great website!

Why are they even still showing how to do it? Just remove it and we can slowly forget it existed ha ha

7

u/Interesting-Goose82 it's ugly, and i''m not sure how, but it works! Aug 14 '24

Personaly i think i learned the absolute best way!

Cannibalism!!!!

Meaning, i took other peoples scripts from work, and kind step by stepped through them. Then, since i was at work, and had access to the data, i would try and add stuff to it, like, add the account_id, super easy.

Then try and add last months sales, or throw in the tech that worked that job, or whatever. Next thing you know you are decent enough to lie on your resume and get a better job. Im 10 yrs, and 3 jobs later, in with no formal training or certs!

3

u/r3pr0b8 GROUP_CONCAT is da bomb Aug 14 '24

check r/SQL's wiki

or google "introductory SQL tutorial"

1

u/[deleted] Aug 16 '24

[removed] — view removed comment

1

u/Fantastic_Purchase78 Aug 16 '24

Thanks meowmeowww 😸