From the course: Advanced SQL for Data Science: Time Series

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Creating a partitioned table

Creating a partitioned table - SQL Tutorial

From the course: Advanced SQL for Data Science: Time Series

Start my 1-month free trial

Creating a partitioned table

- [Instructor] Now let's shift our focus away from indexing and let's take a look at partitioning. Now, for this exercise I'm going to open one of the exercise files and I'm navigating to where I've stored my exercise files, and I've navigated to chapter four. And I'm going to open the file called 4.4 partition by time dot SQL. Now, this exercise file has a number of different parts, so let's take a walk through it. The first statement creates a new table and this new table is called location underscore temp underscore P. Now, location temp P is very similar to location temp but there are a couple of differences. First, I've added a new column called event hour and this is simply going to be an integer between zero and 23 indicating the hour of the day. The other thing you'll notice that's different is there is an additional statement called partition by range and it references that event hour column we're creating. What this statement does is it creates a table but it indicates to…

Contents