SQL Server Command Order Mnemonic

There are people out there who struggle to remember the correct order in which to specify T-SQL commands in Microsoft SQL Server.  While I’m not actually one of them, I did like this nice little mnemonic from guest columnist Andy Owl over at SQL Server mega-resource, SQL Server Central.

Andy’s article about the First 5 SQL Errors To Check For may not be anything new to experienced T-SQL heads but there are plenty of people out there who still make some of those mistakes due to lack of coffee, too many late nights trying to shave a few seconds off that query execution time or even just not paying attention.

My favourite part of his article though, is his mnemonic for remembering the correct order of  commands in a T-SQL SELECT statement.  He claims:

  • Sweaty
  • Feet
  • Will
  • Give
  • Horrible
  • Odours

Of course, corresponding to:

  • SELECT
  • FROM
  • WHERE
  • GROUP BY
  • HAVING
  • ORDER BY

Not bad at all, and something I might try and slip in the next time I’m speaking to someone who’s just learning T-SQL!

Solutions Architect at Indicia. More years than I care to remember wrangling SQL Server and .NET, now mainly AWS. Data geek, football fan, and Xbox gamer. Check out my other blog Press B To Parent if you’re a gamer.

Leave a Reply

Next ArticleVizualize.Me - Your CV as an infographic in a single click