Neoview SQL Reference Manual (R2.5)
Tables
A table is a logical representation of data in which a set of records is represented as a sequence
of rows, and the set of fields common to all rows is represented by columns. A column is a set
of values of the same data type with the same definition. The intersection of a row and column
represents the data value of a particular field in a particular record.
Every table must have one or more columns, but the number of rows can be zero. There is no
inherent order of rows within a table.
You create an SQL user table by using the CREATE TABLE statement in the appropriate
environment. The definition of a user table within the statement includes this information:
• Name of the table
• Name of each column of the table
• Type of data you can store in each column of the table
• Other information about the table, including the physical characteristics of the file that stores
the table (for example, the storage order of rows within the table)
A Neoview SQL table is described in an SQL schema and stored in a physical file in the
environment. An SQL table name can be a fully qualified ANSI name of the form
schema-name.object-name.
Base Tables and Views
In some descriptions of SQL, tables created with a CREATE TABLE statement are referred to as
base tables to distinguish them from views, which are referred to as logical tables.
A view is a named logical table defined by a query specification that uses one or more base tables
or other views. See “Views” (page 312).
Example of a Base Table
For example, this EMPLOYEE table is a base table in a sample database:
SALARYJOBCODEDEPTNUMLAST_NAMEFIRST_NAMEEMPNUM
175500.001009000GREENROGER1
137000.001001000HOWARDJERRY23
32000.003003000WALKERTIM75
. . .. . .. . .. . .. . .. . .
In this sample table, the columns are EMPNUM, FIRST_NAME, LAST_NAME, DEPTNUM,
JOBCODE, and SALARY. The values in each column have the same data type.
310 SQL Language Elements