Sybase Adaptive Server IQ 12.4.2 Administration And Performance Manual page 186

Table of Contents

Advertisement

Using join indexes
Example
166
In the sample database used throughout this book, the
contains three foreign keys, each of which is related to the primary key of
another table.
You can create this table using the following commands:
CREATE TABLE "DBA"."sales_order"(
(
"id"
"cust_id"
REFERENCES "DBA"."customer" ("id")
UNENFORCED,
"order_date"
"fin_code_id"
REFERENCES "DBA"."fin_code" ("code")
UNENFORCED,
"region"
"sales_rep"
REFERENCES "DBA"."employee" ("emp_id")
UNENFORCED,
PRIMARY KEY ("id"),
);
As shown in the figure, the
Each of its foreign key columns can contain many instances of the primary key
it refers to. For example, if you enter:
integer NOT NULL,
integer NOT NULL
datetime NOT NULL,
char(2) NULL
char(7) NULL,
integer NOT NULL
table is at the center of the star join.
sales_order
table
sales_order

Advertisement

Table of Contents
loading

Table of Contents