Introduction to Data Management
Accessing Databases With NonStop SQL
3-16 15873 Tandem Computers Incorporated
Figure 3-8. Administering a Database
S8020-012
SQL
DDL
Report
Writer
CREATE TABLE CUSTOMER
(CUSTNAME CHAR (15),
ADDRESS CHAR (30));
OUT_REPORT $S.#PRINT ;
SET LIST_COUNT 0;
SELECT TABLENAME, COLNAME
FROM COLUMNS;
REPORT TITLE "Dictionary Report" ;
DETAIL TABLENAME HEADING "Tables",
COLNAME HEADING "Columns";
LIST ALL;
Data
Dictionary
Business
Data
Utilities
LOAD CUST, CUSTOMER;
Dictionary Report
Tables Columns
.......... ..........
.......... ..........
.......... ..........
SQLCI
Database
Administrator
Note Do not confuse the data definition language statements mentioned in this discussion with the statements
provided by the standard Tandem Data Definition Language (DDL) product used with ENSCRIBE records
and discussed in Section 4. Although they both operate on objects in a database, these two sets of
statements are entirely different and independent implementations.
Creating the Database and Dictionary
Before you create a database and its dictionary, you must plan the structure of the
database and develop some idea of the values you want to store in it. You can also
name the data elements, determine the most frequent access paths to the data, and
decide on authorization schemes for data security. Once your planning is complete,
the actual work of defining the database is quite straightforward and entails:
1. Creating the data dictionary, consisting of one common catalog or a set of separate
catalogs
2. Creating the database tables and any constraints on the data you plan to enter in
them