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 - SQL Tutorial
From the course: Advanced SQL for Data Science: Time Series
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Example data set 1: Temperature by time and location2m 44s
-
(Locked)
Indexing data set 1: Time index only4m 50s
-
(Locked)
Indexing data set 1: Time and location index4m
-
(Locked)
Creating a partitioned table4m 34s
-
(Locked)
Querying a partitioned table2m 37s
-
(Locked)
Example data set 2: CPU utilization and application type1m 57s
-
(Locked)
Indexing data set 2: Time and type Indexing3m 5s
-
(Locked)
-
-
-