Dev Insights

  • SQL image

How to Write a Good SQL Query

2020-09-24T14:25:21+00:00May 22nd, 2019|

You’ve been coding feverishly for ten minutes. You’ve got twenty table joins lined up, and you’re ready to execute your newest monster SQL query. A single bead of sweat rolls down your forehead as you timidly press the button to execute. You watch the SQL engine spin as it starts to process your query. One second ticks by. You think, “No syntax errors!” Three more seconds. Now you’re starting to get nervous. At the ten-second mark, nervousness gives way to panic. Now you think, “Where’s my data?” At twenty-two seconds, two records finally come back from your query. “That’s the data I’m looking for, but why did it take so long?” you ask yourself. Even the best query writers have been here. So, how do you write better SQL queries to improve your execution? Be Linear Map out a linear path from table to table to table – to get