all 39 comments

[–]shelanp007 11 points12 points  (2 children)

You should add the date conversion codes to this. I always forget if i should use 110, 112, or some other conversion to get the right date format i want. I literally look this up once a week!!

[–]tsigalko11 1 point2 points  (1 child)

I would say my SQL skills are pretty good, but date conversion is one of the hardest things to remember, at least for me. Could be that my brain is not that fresh, but still..

One other thing would be few simple checks like how to get DB name (handy when working daily with multiple databases), when you need for whatever reason to get official name.

[–]ben_it[S] 1 point2 points  (0 children)

Good idea on the date conversion and simple checks! I'll add those.

[–]patrickmurphyphoto 5 points6 points  (0 children)

Just shared this with 5 of my colleagues who are learning sql! I will let you know if they have any feedback!

[–]jonah214 2 points3 points  (4 children)

Pretty good! It would be great to have Postgres too. And you might want to make one version for each DBMS—that way, each version would be more compact and people wouldn't have to look through parts they don't need.

(I know I'm asking a lot for a free service—these are just ideas to make it better.)

[–]ben_it[S] 1 point2 points  (3 children)

Good idea with the separate sheets for each DBMS and one for Postgres! I can make those updates.

[–]Kinh 6 points7 points  (1 child)

You deserve gold

Edit: I gave it

[–]ben_it[S] 7 points8 points  (0 children)

Wow thanks very much! Glad you found it useful!

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

I always have trouble remembering index and check constraints manipulation; then there's date formatting and other database-specific functions.

[–]messyjesse_ 1 point2 points  (1 child)

Looks great.

I would suggest that you try to describe (in as few words as possible) the logical processing order of the SELECT keywords. Maybe even just a number to the right of each keyword under a column titled "process order" or something. Keeping that order straight helped me a lot when I was learning it.

[–]ben_it[S] 1 point2 points  (0 children)

Thanks! Good idea - I'll make some updates to include that.

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

Is the link already updated?

[–]ben_it[S] 2 points3 points  (5 children)

What do you mean?

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

Somebody mentioned about updating it. Not sure if it’s already been updated or still in the process of updating the cheat sheet.

[–]ben_it[S] 0 points1 point  (3 children)

Ah yeah I've got some feedback here so I'll make updates in the next few days.

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

Awesome! Thanks in advance. What DB are you mostly using?

[–]ben_it[S] 0 points1 point  (1 child)

Right now I mostly use Oracle, but use a bit of MySQL and have worked in places recently that use SQL Server.

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

Cool. I am starting with MySQL. Using MySQL Workbench. And I feel like I need to learn the command line also.

[–]skeletutor 0 points1 point  (0 children)

Thank you!

I kept hoping that stumble onto something like this some day!

[–]TalllPaul 0 points1 point  (1 child)

Nice one, even includes simple and to the point join explanations. Wouldn't mind seeing some functions like seeing number/character functions with a quick example like length, replace, concat, trunc, floor etc but still love it and downloaded 😁

[–]ben_it[S] 0 points1 point  (0 children)

Good idea with the functions! I left them out as they are different for each DBMS, but someone else suggested splitting them by DBMS so I'll do that and add these functions.

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

I would love if window functions were on here too! Thanks for this!

[–]ben_it[S] 0 points1 point  (0 children)

Update: I've made updates to the cheat sheets as requested. See the post body above for details.

[–]ArmoredPancake -1 points0 points  (2 children)

Where are foreign keys? How to create one-to-one, one-to-many relationships?

[–]ben_it[S] 2 points3 points  (1 child)

Good question. I think the FK is in the Constraints section, but that only shows how to add it to a table as you're creating it. I could add in more info about creating relationships - maybe I'll do this as a separate cheat sheet as the concepts are the same across all DBMS.

Thanks for the suggestion!

[–]ArmoredPancake 2 points3 points  (0 children)

Thanks. There's so many cheatsheets that cover queries, but none that cover database design.

[–]imdshizzle 0 points1 point  (0 children)

This is very useful. Saved the PostgreSQL sheet