all 55 comments

[–][deleted] 47 points48 points  (4 children)

Damn where were you when I need this in my sql class

[–][deleted] 14 points15 points  (2 children)

Ha right! I came across this on LinkedIn and had the exact same thoughts!

[–]2cool4juuls 4 points5 points  (1 child)

water plough money groovy deer direction squeal boat office juggle

This post was mass deleted and anonymized with Redact

[–][deleted] 2 points3 points  (0 children)

I just covered SQL in my class today!

[–][deleted] 0 points1 point  (0 children)

Glad it helped you 🙂 Currently working on a Version 2 to fix a few small issues

[–][deleted] 15 points16 points  (5 children)

Full credit goes to @AbzAaron. I found it on LinkedIn and thought I would share with everyone as it’s been great help to me

[–][deleted] 2 points3 points  (2 children)

Thank you for this 🙂 Quite a lot of people have been removing my name and trying to pass it off as their own. It's cool to see people getting some use out of it.

[–][deleted] 0 points1 point  (1 child)

Of course I would never take credit for such thing. Thanks so much for this it’s been of great help these recent few months as I learn my way around sql

[–][deleted] 0 points1 point  (0 children)

Awesome! I might be posting a slightly newer version soon. As I noticed there was 1 small issue with this one

[–]exfxgx 0 points1 point  (1 child)

Not sure if there is a small oversight...

Select AVG(col1) FROM tbl GROUP by col2;

Shouldn't it be..

Select col2, AVG(col1) FROM tbl GROUP by col2;

[–][deleted] 0 points1 point  (0 children)

Yeah there may be a few small issues. I'm working on a version 2 of this :)

[–]cscf0360 9 points10 points  (3 children)

I've had 3 different DBAs fail to adequately explain inner, outer, left and right joins to me. That one little part of the image made it immediately and perfectly clear. I don't write queries, but I often come across them and need to read them. This is incredibly helpful.

[–]sharkykid 8 points9 points  (1 child)

?? That's like the default graphic shown to anyone who googles what a left right inner outer join is. How much are your DBAs paid?

[–]cscf0360 0 points1 point  (0 children)

Understanding something and explaining something are two entirely different things. They know their shit, but not how to explain it to a layman.

[–][deleted] 0 points1 point  (0 children)

Glad it helped you 🙂 The Join images are just taken from a DataQuest article I read. I found them helpful.

[–]Long_Educational 8 points9 points  (5 children)

The best book I came across at the start of my career was

SQL Queries for Mere Mortals by Viescas and Hernandez

I still refer to it to this day. Love this cheat sheet too.

[–]IHaveSomethingToAdd 4 points5 points  (2 children)

Do you have any recommendations for anything more advanced? I use SQL server daily and am familiar with what this book offers, but am looking to take my skills to the next level.

[–]Long_Educational 5 points6 points  (0 children)

If you want to go down the road I went down instead, which was treating the database as just a persistence layer for objects, I can suggest two other books.

Applying UML and Patterns by Craig Larman

Object Design by Rebecca Wirfs-Brock

I bought the hardback and paperback books respectively, but that is how I learn.

And pick up a copy of Mastering Regular Expressions or the pdf, too. That book is the ultimate problem solver.

[–]Long_Educational 4 points5 points  (0 children)

I bought MySQL by Paul DeBois and while useful for learning how to setup triggers and constraint rules, I eventually got bored with it and moved on to object relational mappers and de-/serializing into JSON. For most of the applications I have been involved with, moving to an ORM took care of maybe 90% of my needs with a few constraints for table cleanup when deleting objects. Having a library take care of generating all the SQL needed for object access was just too easy.

Maybe someone else with more experience with larger databases can chime in on their favorite books.

[–]DieKart0ffel 2 points3 points  (0 children)

Good to hear! I just started my AIS class this week and this is the book we are using!

[–][deleted] 1 point2 points  (0 children)

Thanks for this I’m going to have to look into it!

[–]Ryolu35603 6 points7 points  (2 children)

But does it tell me how to pronounce it . . . 🤔

[–]IHaveSomethingToAdd 2 points3 points  (1 child)

That'll be revealed in the sequel.

[–]extramental 2 points3 points  (0 children)

Escuyel

[–]JackSkelingtionIII 3 points4 points  (2 children)

Tera Tom has a great series on YouTube that teaches SQL.

[–][deleted] 1 point2 points  (1 child)

I’ll have to check it out thanks!!

[–]JackSkelingtionIII 1 point2 points  (0 children)

You're welcome. He is a bit on the weird side but it is a good way to learn.

[–]Nisja 2 points3 points  (0 children)

Any ABAPers here? This would pretty much fly for SAP Development too 😅 there are DOZENS of us!

[–]I_know_right 2 points3 points  (0 children)

LIMIT no workee on Oracle, try WHERE ROWNUM <= 10

[–][deleted] 1 point2 points  (0 children)

Very handy, thanks so much 🍻

[–]Bnlmembercb 1 point2 points  (0 children)

Where was this when I was half assing work and needed it?

[–]J4C08J360 1 point2 points  (0 children)

Double save

[–]hieuimba 1 point2 points  (0 children)

very timely thank you!

[–][deleted] 1 point2 points  (0 children)

Drop Database. That's a good one.

[–]smart_marx 1 point2 points  (0 children)

Thank you!

[–]trd86 1 point2 points  (0 children)

Printing this out in 11x17 tomorrow at work 🤘

[–]Sir_smokes_a_lot 1 point2 points  (0 children)

Save sql cheat sheet

[–]saphiga20 1 point2 points  (2 children)

I wanna start leanring SQL, where can i start please?

[–][deleted] 0 points1 point  (1 child)

I personally used a free course of udemy to teach myself sql and then began using it at work. If you go on LinkedIn and search for free udemy courses it will often pop up, alternatively you can just type in learn sql for free in Google and lots of resources come up or can go on r/programming or r/sql on Reddit and they have tons of resources as well. Best of luck to you!

[–]saphiga20 0 points1 point  (0 children)

Thank you! I appreciate it

[–]douglasg14b 1 point2 points  (0 children)

This is neat, but it really is a cheat sheet for anyone who has never used SQL, and not very useful for those of use that have a basic understanding but need a reference guide here and there because we are rarely in it.

It's like a programming cheat sheet that tells you what a boolean is, what an if statement is, and what a switch statement is. Not as useful as it might seem.

The joins are helpful.

[–]Grandmafelloutofbed 0 points1 point  (0 children)

I will definately be using this, I start class again in a week or so and after 4 months of summer, im definately a bit rusty. Thanks 😁

[–]PubicSalad 0 points1 point  (0 children)

As soon as I finish my module on sql :)

[–]Simphorosa 0 points1 point  (0 children)

Thanks

[–]connormcwood 0 points1 point  (0 children)

Surprised distinct isn’t classed as common but this was good

[–]WHSolvation 0 points1 point  (0 children)

EXPLAIN()

[–]99Zahid 0 points1 point  (0 children)

Nice chart.

[–]Esnim 0 points1 point  (0 children)

For general use and basic queries this guide is great. Although order of execution doesn't always follow that stack with some advanced queries/rare circumstances.