Policy
policy_key
cust_key
rep_key
SalesRep
rep_key
name
Customer
cust_key
name
subscription_list
AdaptiveServer Enterprise VARCHAR columns are limited to 255
characters,and this limits the number of values that can be stored in the
comma-delimitedlist.
Tabledefinitions Thetable definitions are as follows:
CREATE TABLE SalesRep (
rep_key CHAR( 12 ) NOT NULL,
name CHAR( 40 ) NOT NULL,
PRIMARY KEY ( rep_key )
)
go
CREATE TABLE Customer (
cust_key CHAR( 12 ) NOT NULL,
name CHAR( 40 ) NOT NULL,
subscription_list VARCHAR( 255 ) NULL,
PRIMARY KEY ( cust_key )
)
go
CREATE TABLE Policy (
policy_key INTEGER NOT NULL,
cust_key CHAR( 12 ) NOT NULL,
rep_key CHAR( 12 ) NOT NULL,
FOREIGN KEY ( cust_key )
REFERENCES Customer (cust_key ),
FOREIGN KEY (rep_key )
REFERENCES SalesRep ( rep_key ),
PRIMARY KEY (policy_key)
)
Notes: Thesubscription_list column in the Customer table allows NULLs so
thatcustomers can be added who do not have any sales representatives in
thesubscription_list column.
The publication
Thepublication for this database can be created by the following set of
statements:
//Mark the tables for replication
exec sp_add_remote_table ’SalesRep’
exec sp_add_remote_table ’Policy’
exec sp_add_remote_table ’Customer’
go
158