Creating Composite List-Hash Partitioned Tables

Example 4-12 shows an accounts table that is list partitioned by region and subpartitioned using hash by customer identifier.

To learn how using a subpartition template can simplify the specification of a composite partitioned table, see "Specifying Subpartition Templates to Describe Composite Partitioned Tables".

Example 4-12 Creating a composite list-hash partitioned table

CREATE TABLE accounts
( id             NUMBER
, account_number NUMBER
, customer_id    NUMBER
, balance        NUMBER
, branch_id      NUMBER
, region         VARCHAR(2)
, status         VARCHAR2(1)
)
PARTITION BY LIST (region)
SUBPARTITION BY HASH (customer_id) SUBPARTITIONS 8
( PARTITION p_northwest VALUES ('OR', 'WA')
, PARTITION p_southwest VALUES ('AZ', 'UT', 'NM')
, PARTITION p_northeast VALUES ('NY', 'VM', 'NJ')
, PARTITION p_southeast VALUES ('FL', 'GA')
, PARTITION p_northcentral VALUES ('SD', 'WI')
, PARTITION p_southcentral VALUES ('OK', 'TX')
);