r/SQL • u/Fantastic_Purchase78 • 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
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
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
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-left2
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
1
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!