From the course: Advanced SQL for Application Development

Unlock the full course today

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

Challenge: Define a partitioned table

Challenge: Define a partitioned table

From the course: Advanced SQL for Application Development

Start my 1-month free trial

Challenge: Define a partitioned table

(chill music) - [Instructor] In this challenge, I'd like you to define a sales history table that's partitioned by month of sale. Now in this example, we're going to assume that months are represented as integers from one to 12. And the set of attributes in this table should include a product ID, a product name, which is a variable character, a product type, which is also a variable character, total units sold, which can be an integer, and then the month of the sale. And again, the month of sale could be an integer. Also, create a primary key using both the month of sale and the product ID.

Contents