From the course: SQL Essential Training

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Query composition best practices

Query composition best practices - SQL Tutorial

From the course: SQL Essential Training

Query composition best practices

- [Instructor] Before we add on to what we have just learned with regard to our basic SQL statement, let's point out some things that may not have been that obvious. So in the composition of our SQL statement, we've done a few particular things that I wanted to draw to your attention. So I started with the FROM clause and what this does is point me in the direction of where the data is. So FROM Customer effectively says, go to the Customer table. And by putting SELECT up here and specifying the columns, it's effectively saying, well now that I'm at the Customer table, I'd like to see the first name, last name and email address displayed. And that's exactly what has happened. So let's talk a little bit about how this statement is structured or laid out. We have some indentation taking place and this way of formatting a SQL statement is what's considered part of that best practice. The same best practice that has us…

Contents