Advanced SQL Concepts

Query Execution Order Most people would write their SQL queries starting from SELECT part, because it’s more intuitive and close to our natural language. But actually that’s not the way that SQL queries been executed in query engine. Below is the execution order of a SQL query: FROM, JOIN. Tables are joined to get the base data. WHERE. The base data is filtered. GROUP BY. The filtered based data is grouped....

March 14, 2013 · 2 min · 386 words · Eric

Basic SQL Concepts

Join Full Join Inner Join Left Join Right Join Aggregation Function COUNT(). MAX(). MIN(). SUM(). AVG(). The GROUP BY statement groups rows that have the same values into summary rows, like ‘find the number of customers in each country’. The GROUP BY statement is often used with above aggregation functions to group the result-set by one or more columns.

February 14, 2013 · 1 min · 59 words · Eric