SQL/MX 2.x Reference Manual (G06.24+, H06.03+)
SQL/MX Statements
HP NonStop SQL/MX Reference Manual—523725-004
2-95
Examples of CREATE TABLE
•
This example creates a table stored by primary key. These defaults are in effect: 
POS_LOCATIONS is set to $VOL1, $VOL2, $VOL3 and POS_NUM_OF_PARTNS is 
set to 5.
CREATE TABLE SALES.ODETAIL
 ( ordernum NUMERIC (6) UNSIGNED NO DEFAULT NOT NULL,
 partnum NUMERIC (4) UNSIGNED NO DEFAULT NOT NULL,
 unit_price NUMERIC (8,2) NO DEFAULT NOT NULL,
 qty_ordered NUMERIC (5) UNSIGNED NO DEFAULT NOT NULL,
 PRIMARY KEY (ordernum, partnum) NOT DROPPABLE ) 
 STORE BY PRIMARY KEY;
NonStop SQL/MX will place the primary partition on $VOL1, the second partition 
on $VOL2, the third partition on $VOL3, the fourth on $VOL1, and the fifth on 
$VOL2.
•
This example creates a table stored by primary key. This statement includes a 
LOCATION clause. These defaults are in effect: POS_LOCATIONS is set to $VOL1, 
$VOL2, $VOL3 and POS_NUM_OF_PARTNS is set to 4.
CREATE TABLE SALES.ODETAIL
 ( ordernum NUMERIC (6) UNSIGNED NO DEFAULT NOT NULL,
 partnum NUMERIC (4) UNSIGNED NO DEFAULT NOT NULL,
 unit_price NUMERIC (8,2) NO DEFAULT NOT NULL,
 qty_ordered NUMERIC (5) UNSIGNED NO DEFAULT NOT NULL,
 PRIMARY KEY (ordernum, partnum) NOT DROPPABLE ) 
 LOCATION \NODE3.$DATA1
 STORE BY PRIMARY KEY;
NonStop SQL/MX will place the primary partition on $DATA1, the second partition 
on $VOL1, the third partition on $VOL2, and the forth partition on $VOL3.










