In dynamic partitioning, the values of partitioned columns exist within the table. So, it is not required to pass the values of partitioned columns manually.
- First, select the database in which we want to create a table.
- Enable the dynamic partition by using the following commands: -
- Create a dummy table to store the data.
- Now, load the data into the table.
- Create a partition table by using the following command: -
- Now, insert the data of dummy table into the partition table.
- In the following screenshot, we can see that the table student_part is divided into two categories.
- Let's retrieve the entire data of the table by using the following command: -
- Now, try to retrieve the data based on partitioned columns by using the following command: -
In this case, we are not examining the entire data. Hence, this approach improves query response time.
- Let's also retrieve the data of another partitioned dataset by using the following command: -