xvi
The sample database
There is a sample database included with Adaptive Server Anywhere. Many
of the examples throughout the documentation use this sample database.
The sample database represents a small company. It contains internal
information about the company (employees, departments, and financial data)
as well as product information (products), sales information (sales orders,
customers, and contacts), and financial information (fin_code, fin_data).
The following figure shows the tables in the sample database and how they
are related to each other.
id = id
id = prod_id
code = fin_code_id
emp_id = sales_rep
id = cust_id
code = code
dept_id = dept_id
emp_id = dept_head_id
contact
id <pk> integer
last_name char(15)
first_name char(15)
title char(2)
street char(30)
city char(20)
state char(2)
zip char(5)
phone char(10)
fax char(10)
customer
id <pk> integer
fname char(15)
lname char(20)
address char(35)
city char(20)
state char(2)
zip char(10)
phone char(12)
company_name char(35)
sales_order
id <pk> integer
cust_id <fk> integer
order_date date
fin_code_id <fk> char(2)
region char(7)
sales_rep <fk> integer
fin_code
code <pk> char(2)
type char(10)
description char(50)
fin_data
year <pk> char(4)
quarter <pk> char(2)
code <pk,fk> char(2)
amount numeric(9)
product
id <pk> integer
name char(15)
description char(30)
size char(18)
color char(6)
quantity integer
unit_price numeric(15,2)
sales_order_items
id <pk,fk> integer
line_id <pk> smallint
prod_id <fk> integer
quantity integer
ship_date date
employee
emp_id <pk> integer
manager_id integer
emp_fname char(20)
emp_lname char(20)
dept_id <fk> integer
street char(40)
city char(20)
state char(4)
zip_code char(9)
phone char(10)
status char(1)
ss_number char(11)
salary numeric(20,3)
start_date date
termination_date date
birth_date date
bene_health_ins char(1)
bene_life_ins char(1)
bene_day_care char(1)
sex char(1)
department
dept_id <pk> integer
dept_name char(40)
dept_head_id <fk> integer
asademo.db