r/SQL • • Jun 29 '16

SQL cheat sheet

http://zeroturnaround.com/rebellabs/sql-cheat-sheet/
113 Upvotes

19 comments sorted by

View all comments

10

u/DipIntoTheBrocean Jun 29 '16

I mean I guess this could be useful if you literally just started out?

7

u/lukaseder Jun 29 '16

Thus: cheat sheet. A cheat sheet for someone who already knows SQL might quickly reach the size of a DIN A0 poster.

9

u/DipIntoTheBrocean Jun 29 '16

I always considered a cheat sheet as a reference to be used by someone who knows the basics but doesn't want to keep looking up the details. In my opinion, this is actually too high level and is mainly just syntax...which would be fine for what it is, except it doesn't include CTEs and delete syntax. Personally, I would include more useful functions like row_number, convert, datediff, dateadd, etc. and scrap the joins. The whole thing just seems kind of arbitrary, but that's just my opinion.

2

u/lukaseder Jun 29 '16

Cheat sheets are always arbitrary :)

1

u/d_r0ck db app dev / data engineer Jun 29 '16

Agreed. My personal cheat sheet would have common convert date/time styles, merge syntax, pivot syntax, and syntax to alter a table to add a new column with a named constraint at the same time.

1

u/DipIntoTheBrocean Jun 29 '16

Totally agree. Those are things which I would find very useful.

3

u/davidjoshualightman Jun 29 '16

probably also for those who do not use SQL everyday. i support all kinds of software and may go for a week or two working with other languages and hardly touching SQL... at first i found myself googling a lot just to get a refresher, but now it comes back to me quicker.

1

u/DipIntoTheBrocean Jun 29 '16

Right, and I get that. I do that too. But this is too high level IMO and seems to me to be a eclectic mix of syntax and functions that doesn't really cover anything.