CHAPTER 3 Working with Database Objects
119
2
Click the Tables folder for that database.
3
Double-click Add Table in the right panel.
4
Enter a Name for the table.
5
To create an IQ table, skip this step. To create a table in the Catalog Store,
double-click the Advanced Table Properties icon, and select SYSTEM
from the DB space dropdown list.
6
Enter the columns you want and their data types and other attributes in the
Table Editor.
7
Click OK to create the table.
SQL statement for
creating tables
The SQL statement for creating tables is
CREATE TABLE
.
This section describes how to use the
CREATE TABLE
statement. The examples
in this section use the sample database. To try the examples, run DBISQL and
connect to the sample database with user ID DBA and password SQL.
For information on connecting to the sample database from DBISQL, see
“Connecting to a database from DBISQL”.
You can create tables with other tools in addition to DBISQL. The SQL
statements described here are independent of the tool you are using.
Example
The following statement creates a new, permanent IQ table to describe
qualifications of employees within a company. The table has columns to hold
an identifying number, a name, and a type (say
technical
or
administrative
) for
each skill.
CREATE TABLE skill (
skill_id INTEGER NOT NULL,
skill_name CHAR( 20 ) NOT NULL,
skill_type CHAR( 20 ) NOT NULL
)
You can execute this command by typing it into the DBISQL command
window, and pressing the execute key (F9).
•
Each column has a data type. The
skill_id
is an
integer
(like 101), the
skill_name
is a fixed-width
CHARACTER
string containing up to 20
characters, and so on.
•
The phrase NOT NULL after their data types indicates that all columns in
this example must contain a value.
•
In general, you would not create a table that has no primary key. To create
a primary key, see “Creating primary and foreign keys” on page 125.
Содержание Adaptive Server IQ 12.4.2
Страница 1: ...Administration and Performance Guide Adaptive Server IQ 12 4 2 ...
Страница 16: ...xvi ...
Страница 20: ...Related documents xx ...
Страница 40: ...Compatibility with earlier versions 20 ...
Страница 118: ...Troubleshooting startup shutdown and connections 98 ...
Страница 248: ...Importing data by replication 228 ...
Страница 306: ...Integrity rules in the system tables 286 ...
Страница 334: ...Cursors in transactions 314 ...
Страница 396: ...Users and permissions in the system tables 376 ...
Страница 438: ...Determining your data backup and recovery strategy 418 ...
Страница 484: ...Network performance 464 ...
Страница 500: ...System utilities to monitor CPU use 480 ...
Страница 514: ...Characteristics of Open Client and jConnect connections 494 ...
Страница 536: ...Index 516 ...