![]() ![]() NOTES: The above order is the LOGICAL order, which is different from the PHYSICAL execution order. LIMIT & OFFSET: Perhaps due to pagination, we want to limit the data returned, so we're returning just a subset of the rows above. Here, the data set remains the same, we're just changing the ordering of the rows.ħ. ORDER BY: Perhaps we want to order the data set - sorting data in ascending or descending order based on columns. That's it, we now have the resulting data set.Ħ. SELECT: We can select column names as well as aggregations. (This is similar to the WHERE clause - in WHERE, we are filtering rows, whereas in HAVING we are filtering buckets).ĥ. This is where we can specify some conditions, so that we choose just some buckets, and discard others. HAVING: Perhaps we don't want all our buckets. These buckets help us perform aggregations.Ĥ. Each bucket has a key and the associated rows. GROUP BY: Time to make some buckets! When we're grouping data, we're creating buckets (groups). ![]() WHERE: Perhaps we don't want the whole merged working set - perhaps we want to filter this data, so this means we end up with a subset of our working set - we've retained some rows and discarded other rows.ģ. FROM & JOIN: The DB looks at the tables we specified in FROM and in the JOINs, and then merges this data - this merged data is our starting "working set".Ģ. What's the logical order of SQL query operations?ġ. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |