SQL/MX 3.1 Installation and Management Guide (H06.23+, J06.12+)

Creating an SQL/MX Database
HP NonStop SQL/MX Release 3.1 Installation and Management Guide663852-001
7-12
Security Rules for Creating and Altering SQL/MX
Tables
For information about loading tables, see the guidelines for loading tables in
Section 10, Reorganizing SQL/MX Tables and Maintaining Data.
Security Rules for Creating and Altering SQL/MX Tables
Table security ultimately defines much of the security for indexes and views.
The rules for creating and altering tables are:
To create an SQL/MX table or other object (including index, view, SPJ, or SQL/MP
alias), you must own its schema or be a super ID user acting on behalf of the
owner.
To alter a table, you must own its schema or be a super ID user acting on behalf of
the owner.
For more information about security and access privileges for tables and other
SQL/MX database objects, see Access Privileges for SQL/MX Database Objects on
page 7-10.
Creating and Using Keys
Create and use these keys for SQL/MX tables and their indexes:
Primary key. See Creating and Using a Primary Key on page 7-12.
Clustering key. See Creating and Using a Clustering Key on page 7-13.
SYSKEY. See Using the SYSKEY on page 7-14.
Partially decoupling the clustering and partitioning keys. See Partially Decoupling
the Clustering Key and the Partitioning Key on page 7-15.
Partitioning key. See Creating and Using a Partitioning Key on page 7-15 and
Creating Indexes for SQL/MX Tables
on page 7-33.
Creating and Using a Primary Key
A primary key is the column or set of columns that defines a unique key for a table.
Primary key columns cannot contain nulls, so each one must be declared NOT NULL.
Use the PRIMARY KEY constraint clause in CREATE TABLE to specify the table
columns of a primary key. For NonStop SQL/MX, you use the primary key to:
Specify one or more columns that uniquely define and identify each row.
Provide an implicit method for defining the columns of the clustering key, but only if
the primary key is NOT DROPPABLE. You can use a primary key that is NOT
DROPPABLE as the clustering key. If the primary key is droppable, you cannot use
it as the clustering key.
The PRIMARY KEY constraint is one of several types of constraints that you define for
an SQL/MX table. Each table or index can have only one PRIMARY KEY constraint but