Chapter 5. A Tutorialfor Adaptive Server Enterprise Users

tableto the SalesRep table. Therelationship between the Customer table

andthe SalesRep table is many-to-one.

Thetables in the
database Thetables are described in more detail as follows:
Table Description
SalesRep One row for each sales representativethat works for the
company.The SalesRep table has the following columns:
rep_key An identifier for each sales representative.
Thisis the primary key.
name Thename of each sales representative.
TheSQL statement creating this table is as follows:
CREATE TABLE SalesRep (
rep_key CHAR(12) NOT NULL,
name CHAR(40) NOT NULL,
PRIMARY KEY (rep_key)
)
Customer One row for each customer that does business with the
company. The Customer table includes the following
columns:
cust_key Anidentifier for each customer. This is the
primarykey.
name Thename of each customer.
rep_key Anidentifier for the sales representative in a
salesrelationship. Thisis a foreign key to the SalesRep
table.
TheSQL statement creating this table is as follows:
CREATE TABLE Customer (
cust_key CHAR(12) NOT NULL,
name CHAR(40) NOT NULL,
rep_key CHAR(12) NOT NULL,
FOREIGN KEY ( rep_key )
REFERENCES SalesRep (rep_key
),
PRIMARY KEY (cust_key)
)
Replication goals
Thegoals of the replication design are to provide each sales representative
withthe following information:

55