SQL/MX 3.1 Installation and Management Guide (H06.23+, J06.12+)
Understanding and Planning SQL/MX Tables
HP NonStop SQL/MX Release 3.1 Installation and Management Guide—663852-001
4-10
Using SQL/MX Tables
For information about determining an SQL/MP database layout, see the SQL/MP
Installation and Management Guide.
Using SQL/MX Tables
You can use SQL/MX tables to externalize all the data to the user. Using tables is the
most direct method because views, constraints, and indexes ultimately depend on their
underlying tables.
Advantages to using only tables as the external database scheme include:
All other SQL/MX objects (views, indexes, constraints, and so on) are directly or
indirectly dependent on the tables.
Recovery and management methods are simplified.
Disadvantages include:
Although you can restrict access to specified table columns when you use GRANT
to provide a user with UPDATE or REFERENCES privileges to a table, the GRANT
SELECT, DELETE, INSERT, and ALL privileges provide the user with access to all
columns in the table. To protect your tables from access by unauthorized users,
provide GRANT privileges to table views.
Alterations to tables generally have a greater impact on application code that uses
the tables directly. For example, an application should not use SELECT * to
retrieve values from a table, because adding a column to the table would mean
that the application must change.
Using Views
A view is a logical table derived from one or more tables. A view can include any SQL
query from one or more tables or other views. You can create more than one view on a
table or combination of tables.
Use views to externalize some or all of the data to the user.
A view can have the same structure as an underlying table, or the view can be
different. Views do not store data physically on the disk.
In general, views have these advantages and uses:
To enable the apparent structure of retrieved data to be different from the actual
stored data
To enable logical renaming of columns
To redefine headings for columns










