From the course: SQL for Data Analysis

Unlock the full course today

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

Common SQL structures

Common SQL structures - SQL Tutorial

From the course: SQL for Data Analysis

Common SQL structures

- Now let's take a look at how to ask the right questions to get the results you want using some common SQL syntax. Let's start by opening up your code space environment and going to visual studio code. Let's make sure we are connected to the H plus Sport database, and can view the tables in the explore window. I see all five of the tables from the entity relationship diagram, customers, orders order item, product, and salesperson tables. When developing a good SQL query, it's important to determine a detailed question that you want to ask of the data. If not, you may end up with the wrong results. This could be the difference between asking about the number of times a customer has been to your website, and the number of times a customer has ordered from your website. Questions that can help you develop a more detailed query are, what tables do you need to access? What are the fields of interest? What data do we…

Contents