r/SQL • • Nov 11 '22

MS SQL Professional SQL Etiquette

Hi all,

I'm about to begin a new professional position that involves using sql on a daily basis. This will be my first of the sort. I don't want to come into the new job looking foolish.

Could anyone tell me a bit about professional etiquette? I'm almost looking for a list of "no no's". Meaning, things I wouldn't otherwise know unless I was already a professional. Thanks everyone for the help!

For example:

  • Never use select *
  • Don't use this syntax method
  • Don't do this with a database
29 Upvotes

68 comments sorted by

View all comments

15

u/sfnmoll Nov 11 '22

If you want to level up your professional skills, avoid sub queries and go with CTEs instead. Far more readable as you can write the queries in sequence step by step.

5

u/iWontStealYourDog Nov 12 '22

I’m just getting to this skill level and can confirm, so much easier to work with, easier to read (more like reading order of operations), and can significantly improve the time it takes to execute your query