--
--
-- SQL Script  : Create_Schema_HT.sql
--
-- Description : This SQL script creates the Hardware Tracking Schema
--               version 1.5.1 in the Oracle RDBMS.
--
--


--
-- Delete the existing tables
--
DROP TABLE Response			CASCADE CONSTRAINTS;
DROP TABLE Response_HP			CASCADE CONSTRAINTS;
DROP TABLE Response_LP			CASCADE CONSTRAINTS;
DROP TABLE Response_PZ			CASCADE CONSTRAINTS;
DROP TABLE Response_PN			CASCADE CONSTRAINTS;
DROP TABLE Response_PN_Data		CASCADE CONSTRAINTS;
DROP TABLE Sensor			CASCADE CONSTRAINTS;
DROP TABLE Sensor_Component		CASCADE CONSTRAINTS;
DROP TABLE Filamp			CASCADE CONSTRAINTS;
DROP TABLE Filamp_PChannel		CASCADE CONSTRAINTS;
DROP TABLE Datalogger			CASCADE CONSTRAINTS;
DROP TABLE Datalogger_Board		CASCADE CONSTRAINTS;
DROP TABLE Datalogger_Module		CASCADE CONSTRAINTS;
DROP TABLE Filter_FIR			CASCADE CONSTRAINTS;
DROP TABLE Filter_FIR_Data		CASCADE CONSTRAINTS;
DROP TABLE Filter			CASCADE CONSTRAINTS;
DROP TABLE Filter_Sequence		CASCADE CONSTRAINTS;
DROP TABLE Filter_Sequence_Data		CASCADE CONSTRAINTS;
DROP TABLE Station			CASCADE CONSTRAINTS;
DROP TABLE Station_Sensor		CASCADE CONSTRAINTS;
DROP TABLE Station_Sensor_Component	CASCADE CONSTRAINTS;
DROP TABLE Station_Filamp		CASCADE CONSTRAINTS;
DROP TABLE Station_Filamp_PChannel	CASCADE CONSTRAINTS;
DROP TABLE Station_Digitizer		CASCADE CONSTRAINTS;
DROP TABLE Station_Digitizer_PChannel	CASCADE CONSTRAINTS;
DROP TABLE Station_Datalogger		CASCADE CONSTRAINTS;
DROP TABLE Station_Datalogger_PChannel	CASCADE CONSTRAINTS;
DROP TABLE Station_Datalogger_LChannel	CASCADE CONSTRAINTS;


--
-- Create the new schema
--
CREATE SCHEMA AUTHORIZATION ncedcdba;

CREATE TABLE Response (
seqresp_id	NUMBER(8)	NOT NULL,
resp_nb		NUMBER(8)	NOT NULL,
resp_type	VARCHAR2(1)	NOT NULL,
resp_id		NUMBER(8)	NOT NULL,
unit_in		NUMBER(8)	NOT NULL,
unit_out	NUMBER(8)	NOT NULL,
r_type		VARCHAR2(1),
lddate		DATE		DEFAULT (SYSDATE),
CONSTRAINT	Re00		PRIMARY KEY (seqresp_id, resp_nb),
CONSTRAINT	Re01		CHECK (r_type IN ('A','B','C','D','P')),
CONSTRAINT	Re02		CHECK (resp_nb >= 1),
CONSTRAINT	Re03		CHECK (resp_type IN ('H','L','P','Z','F','N'))
) TABLESPACE	HT001;

CREATE TABLE Response_HP (
hp_id		NUMBER(8)	NOT NULL,
filter_type	VARCHAR2(2)	NOT NULL,
nb_pole		NUMBER(8)	NOT NULL,
corner_freq	FLOAT		NOT NULL,
damping_value	FLOAT		NOT NULL,
lddate		DATE		DEFAULT (SYSDATE),
CONSTRAINT	RHP00		PRIMARY KEY (hp_id),
CONSTRAINT	RHP01		CHECK (filter_type IN ('BW','DG','ND')),
CONSTRAINT	RHP02		CHECK (nb_pole > 0)
) TABLESPACE	HT001;

CREATE TABLE Response_LP (
lp_id		NUMBER(8)	NOT NULL,
filter_type	VARCHAR2(2),
nb_pole		NUMBER(8),
corner_freq	FLOAT		NOT NULL,
damping_value	FLOAT		NOT NULL,
lddate		DATE		DEFAULT (SYSDATE),
CONSTRAINT	RLP00		PRIMARY KEY (lp_id),
CONSTRAINT	RLP01		CHECK (filter_type IN ('BW','DG','ND')),
CONSTRAINT	RLP02		CHECK (nb_pole > 0)
) TABLESPACE	HT001;

CREATE TABLE Response_PZ (
pz_id		NUMBER(8)	NOT NULL,
pz_nb		NUMBER(8)	NOT NULL,
type		VARCHAR2(1)	NOT NULL,
r_value		FLOAT		NOT NULL,
r_error		FLOAT,
i_value		FLOAT		NOT NULL,
i_error		FLOAT,
lddate		DATE		DEFAULT (SYSDATE),
CONSTRAINT	RPZ00		PRIMARY KEY (pz_id, pz_nb),
CONSTRAINT	RPZ01		CHECK (pz_nb >= 1),
CONSTRAINT	RPZ02		CHECK (type IN ('P','Z'))
) TABLESPACE	HT001;

CREATE TABLE Response_PN (
pn_id		NUMBER(8)	NOT NULL,
name		VARCHAR2(80),
poly_type	VARCHAR2(1)	NOT NULL,
lower_bound	FLOAT,
upper_bound	FLOAT,
max_error	FLOAT,
nb_coeff	NUMBER(8),
lddate		DATE		DEFAULT (SYSDATE),
CONSTRAINT	RPN00		PRIMARY KEY (pn_id),
CONSTRAINT	RPN01		CHECK (nb_coeff >= 0),
CONSTRAINT	RPN02		CHECK (poly_type IN ('C','L','M'))
) TABLESPACE	HT001;

CREATE TABLE Response_PN_Data (
pn_id		NUMBER(8)	NOT NULL,
pn_nb		NUMBER(8)	NOT NULL,
pn_value	FLOAT		NOT NULL,
CONSTRAINT	RPND00		PRIMARY KEY (pn_id, pn_nb),
CONSTRAINT	RPND01		CHECK (pn_nb >= 1)
) TABLESPACE	HT001;

CREATE TABLE Sensor (
sensor_id	NUMBER(8)	NOT NULL,
name		VARCHAR2(80),
serial_nb	VARCHAR2(80),
ondate		DATE		NOT NULL,
offdate		DATE,
nb_component	NUMBER(8)	NOT NULL,
lddate		DATE		DEFAULT (SYSDATE),
CONSTRAINT	Sensor00	PRIMARY KEY (sensor_id),
CONSTRAINT	Sensor01	CHECK (nb_component >= 0)
) TABLESPACE	HT001;

CREATE TABLE Sensor_Component (
sensor_id	NUMBER(8)	NOT NULL,
component_nb	NUMBER(8)	NOT NULL,
channel_comp	VARCHAR2(2),
component_type	VARCHAR2(1),
sensitivity	FLOAT		NOT NULL,
frequency	FLOAT,
seqresp_id	NUMBER(8),
lddate		DATE		DEFAULT (SYSDATE),
CONSTRAINT	SeC00		PRIMARY KEY (sensor_id, component_nb),
CONSTRAINT	SeC01		CHECK (component_nb >= 1),
CONSTRAINT	SeC02		CHECK (frequency >= 0.0)
) TABLESPACE	HT001;

CREATE TABLE Filamp (
filamp_id	NUMBER(8)	NOT NULL,
name		VARCHAR2(80),
serial_nb	VARCHAR2(80),
ondate		DATE		NOT NULL,
offdate		DATE,
nb_pchannel	NUMBER(8)	NOT NULL,
lddate		DATE		DEFAULT (SYSDATE),
CONSTRAINT	Filamp00	PRIMARY KEY (filamp_id),
CONSTRAINT	Filamp01	CHECK (nb_pchannel >= 0)
) TABLESPACE	HT001;

CREATE TABLE Filamp_PChannel (
filamp_id	NUMBER(8)	NOT NULL,
pchannel_nb	NUMBER(8)	NOT NULL,
gain		FLOAT,
frequency	FLOAT,
seqresp_id	NUMBER(8),
lddate		DATE		DEFAULT (SYSDATE),
CONSTRAINT	FiP00		PRIMARY KEY (filamp_id, pchannel_nb),
CONSTRAINT	FiP01		CHECK (pchannel_nb >= 1)
) TABLESPACE	HT001;

CREATE TABLE Datalogger (
data_id		NUMBER(8)	NOT NULL,
data_type	VARCHAR2(80),
serial_nb	VARCHAR2(80),
firmware_nb	VARCHAR2(80),
software	VARCHAR2(80),
software_nb	VARCHAR2(80),
ondate		DATE		NOT NULL,
offdate		DATE,
nb_board	NUMBER(8),
word_32		NUMBER(8)	NOT NULL,
word_16		NUMBER(8)	NOT NULL,
lddate		DATE		DEFAULT (SYSDATE),
CONSTRAINT	Da00		PRIMARY KEY (data_id),
CONSTRAINT	Da01		CHECK (nb_board >= 0)
) TABLESPACE	HT001;

CREATE TABLE Datalogger_Board (
data_id		NUMBER(8)	NOT NULL,
board_nb	NUMBER(8)	NOT NULL,
serial_nb	VARCHAR2(80),
nb_module	NUMBER(8)	NOT NULL,
lddate		DATE		DEFAULT (SYSDATE),
CONSTRAINT	DaB00		PRIMARY KEY (data_id, board_nb),
CONSTRAINT	DaB01		CHECK (board_nb >= 1),
CONSTRAINT	DaB02		CHECK (nb_module >= 0)
) TABLESPACE	HT001;

CREATE TABLE Datalogger_Module (
data_id		NUMBER(8)	NOT NULL,
board_nb	NUMBER(8)	NOT NULL,
module_nb	NUMBER(8)	NOT NULL,
serial_nb	VARCHAR2(80),
sensitivity	FLOAT,
lddate		DATE		DEFAULT (SYSDATE),
CONSTRAINT	DaM00		PRIMARY KEY (data_id, board_nb, module_nb),
CONSTRAINT	DaM01		CHECK (board_nb >= 1),
CONSTRAINT	DaM02		CHECK (module_nb >= 1)
) TABLESPACE	HT001;

CREATE TABLE Filter_FIR (
fir_id		NUMBER(8)	NOT NULL,
name		VARCHAR2(80),
symmetry	VARCHAR2(1)	NOT NULL,
gain		FLOAT,
lddate		DATE		DEFAULT (SYSDATE),
CONSTRAINT	FFIR00		PRIMARY KEY (fir_id),
CONSTRAINT	FFIR01		CHECK (symmetry IN ('E','O','N'))
) TABLESPACE	HT001;

CREATE TABLE Filter_FIR_Data (
fir_id		NUMBER(8)	NOT NULL,
coeff_nb	NUMBER(8)	NOT NULL,
type		VARCHAR2(1)	NOT NULL,
coefficient	FLOAT		NOT NULL,
error		FLOAT,
CONSTRAINT	FFD00		PRIMARY KEY (fir_id, coeff_nb),
CONSTRAINT	FFD01		CHECK (coeff_nb >= 1),
CONSTRAINT	FFD02		CHECK (type IN ('N','D'))
) TABLESPACE	HT001;

CREATE TABLE Filter (
filter_id	NUMBER(8)	NOT NULL,
gain		FLOAT,
frequency	FLOAT,
in_sp_rate	FLOAT,
out_sp_rate	FLOAT,
offset		NUMBER(8),
delay		FLOAT,
correction	FLOAT		NOT NULL,
seqresp_id	NUMBER(8)	NOT NULL,
lddate		DATE		DEFAULT (SYSDATE),
CONSTRAINT	Fi00		PRIMARY KEY (filter_id),
CONSTRAINT	Fi01		CHECK (frequency >= 0.0),
CONSTRAINT	Fi02		CHECK (in_sp_rate > 0.0),
CONSTRAINT	Fi03		CHECK (out_sp_rate > 0.0),
CONSTRAINT	Fi04		CHECK (offset >= 0)
) TABLESPACE	HT001;

CREATE TABLE Filter_Sequence (
seqfil_id	NUMBER(8)	NOT NULL,
name		VARCHAR2(32)	NOT NULL,
nb_filter	NUMBER(8)	NOT NULL,
gain		FLOAT,
frequency	FLOAT,
lddate		DATE		DEFAULT (SYSDATE),
CONSTRAINT	FiS00		PRIMARY KEY (seqfil_id),
CONSTRAINT	FiS01		CHECK (frequency >= 0.0),
CONSTRAINT	FiS02		CHECK (nb_filter >= 0)
) TABLESPACE	HT001;

CREATE TABLE Filter_Sequence_Data (
seqfil_id	NUMBER(8)	NOT NULL,
filter_nb	NUMBER(8)	NOT NULL,
filter_id	NUMBER(8)	NOT NULL,
CONSTRAINT	FiSeD00		PRIMARY KEY (seqfil_id, filter_nb),
CONSTRAINT	FiSeD01		CHECK (filter_nb >= 1)
) TABLESPACE	HT001;

CREATE TABLE Station (
sta		VARCHAR2(6)	NOT NULL,
net		VARCHAR2(8)	NOT NULL,
lat		FLOAT,
lon		FLOAT,
elev		FLOAT,
staname		VARCHAR2(50),
nb_sensor	NUMBER(8),
nb_filamp	NUMBER(8),
nb_digi		NUMBER(8)	NOT NULL,
nb_data		NUMBER(8)	NOT NULL,
datumhor	VARCHAR2(8),
datumver	VARCHAR2(8),
ondate		DATE		NOT NULL,
offdate		DATE,
lddate		DATE		DEFAULT (SYSDATE),
CONSTRAINT	St00		PRIMARY KEY (sta, net, ondate),
CONSTRAINT	St01		CHECK (datumhor IN ('NAD27','WGS84')),
CONSTRAINT	St02		CHECK (datumver IN ('NAD27','WGS84','AVERAGE')),
CONSTRAINT	St03		CHECK (elev >= -5000.0 AND elev <= 5000.0),
CONSTRAINT	St04		CHECK (lat >= -90.0 AND lat <= 90.0),
CONSTRAINT	St05		CHECK (lon >= -180.0 AND lon <= 180.0),
CONSTRAINT	St06		CHECK (nb_data >= 0),
CONSTRAINT	St07		CHECK (nb_digi >= 0),
CONSTRAINT	St08		CHECK (nb_filamp >= 0),
CONSTRAINT	St09		CHECK (nb_sensor >= 0)
) TABLESPACE	HT001;

CREATE TABLE Station_Sensor (
sta		VARCHAR2(6)	NOT NULL,
net		VARCHAR2(8)	NOT NULL,
sensor_nb	NUMBER(8)	NOT NULL,
sensor_id	NUMBER(8)	NOT NULL,
lat		FLOAT,
lon		FLOAT,
elev		FLOAT,
edepth		FLOAT,
nb_component	NUMBER(8)	NOT NULL,
datumhor	VARCHAR2(8),
datumver	VARCHAR2(8),
ondate		DATE,
offdate		DATE,
lddate		DATE		DEFAULT (SYSDATE),
CONSTRAINT	StSe00		PRIMARY KEY (sta, net, sensor_nb, ondate),
CONSTRAINT	StSe01		CHECK (datumhor IN ('NAD27','WGS84')),
CONSTRAINT	StSe02		CHECK (datumver IN ('NAD27','WGS84','AVERAGE')),
CONSTRAINT	StSe03		CHECK (edepth >= 0.0),
CONSTRAINT	StSe04		CHECK (elev >= -5000.0 AND elev <= 5000.0),
CONSTRAINT	StSe05		CHECK (lat >= -90.0 AND lat <= 90.0),
CONSTRAINT	StSe06		CHECK (lon >= -180.0 AND lon <= 180.0),
CONSTRAINT	StSe07		CHECK (nb_component >= 0),
CONSTRAINT	StSe08		CHECK (sensor_nb >= 1)
) TABLESPACE	HT001;

CREATE TABLE Station_Sensor_Component (
sta			VARCHAR2(6)	NOT NULL,
net			VARCHAR2(8)	NOT NULL,
sensor_nb		NUMBER(8)	NOT NULL,
component_nb		NUMBER(8)	NOT NULL,
next_hard_type		VARCHAR2(1)	NOT NULL,
next_hard_nb		NUMBER(8)	NOT NULL,
next_hard_pchannel	NUMBER(8)	NOT NULL,
azimuth			FLOAT,
dip			FLOAT,
ondate			DATE,
offdate			DATE,
lddate			DATE		DEFAULT (SYSDATE),
CONSTRAINT		StSeC00		PRIMARY KEY (sta, net, sensor_nb, component_nb, ondate),
CONSTRAINT		StSeC01		CHECK (azimuth >= 0.0 AND azimuth <= 360.0),
CONSTRAINT		StSeC02		CHECK (component_nb >= 1),
CONSTRAINT		StSec03		CHECK (dip >= -90.0 AND dip <= 90.0),
CONSTRAINT		StSec04		CHECK (next_hard_nb >= 1),
CONSTRAINT		StSec05		CHECK (next_hard_pchannel >= 1),
CONSTRAINT		StSec06		CHECK (next_hard_type IN ('F','D')),
CONSTRAINT		StSec07		CHECK (sensor_nb >= 1)
) TABLESPACE	HT001;

CREATE TABLE Station_Filamp (
sta		VARCHAR2(6)	NOT NULL,
net		VARCHAR2(8)	NOT NULL,
filamp_nb	NUMBER(8)	NOT NULL,
filamp_id	NUMBER(8)	NOT NULL,
nb_pchannel	NUMBER(8)	NOT NULL,
ondate		DATE,
offdate		DATE,
lddate		DATE		DEFAULT (SYSDATE),
CONSTRAINT	StFi00		PRIMARY KEY (sta, net, filamp_nb, ondate),
CONSTRAINT	StFi01		CHECK (filamp_nb >= 1),
CONSTRAINT	StFi02		CHECK (nb_pchannel >= 0)
) TABLESPACE	HT001;

CREATE TABLE Station_Filamp_PChannel (
sta			VARCHAR2(6)	NOT NULL,
net			VARCHAR2(8)	NOT NULL,
filamp_nb		NUMBER(8)	NOT NULL,
pchannel_nb		NUMBER(8)	NOT NULL,
next_hard_type		VARCHAR2(1)	NOT NULL,
next_hard_nb		NUMBER(8)	NOT NULL,
next_hard_pchannel	NUMBER(8)	NOT NULL,
ondate			DATE,
offdate			DATE,
lddate			DATE		DEFAULT (SYSDATE),
CONSTRAINT		StFiP00		PRIMARY KEY (sta, net, filamp_nb, pchannel_nb, ondate),
CONSTRAINT		StFiP01		CHECK (filamp_nb >= 1),
CONSTRAINT		StFiP02		CHECK (next_hard_nb >= 1),
CONSTRAINT		StFiP03		CHECK (next_hard_pchannel >= 1),
CONSTRAINT		StFiP04		CHECK (next_hard_type IN ('F','D')),
CONSTRAINT		StFiP05		CHECK (pchannel_nb >= 1)
) TABLESPACE	HT001;

CREATE TABLE Station_Digitizer (
sta		VARCHAR2(6)	NOT NULL,
net		VARCHAR2(8)	NOT NULL,
digi_nb		NUMBER(8)	NOT NULL,
serial_nb	VARCHAR2(80)	NOT NULL,
nb_pri_pchannel	NUMBER(8)	NOT NULL,
nb_aux_pchannel	NUMBER(8)	NOT NULL,
ondate		DATE,
offdate		DATE,
lddate		DATE		DEFAULT (SYSDATE),
CONSTRAINT	StDi00		PRIMARY KEY (sta, net, digi_nb, ondate),
CONSTRAINT	StDi01		CHECK (digi_nb >= 1),
CONSTRAINT	StDi02		CHECK (nb_aux_pchannel >= 0),
CONSTRAINT	StDi03		CHECK (nb_pri_pchannel >= 0)
) TABLESPACE	HT001;

CREATE TABLE Station_Digitizer_PChannel (
sta		VARCHAR2(6)	NOT NULL,
net		VARCHAR2(8)	NOT NULL,
digi_nb		NUMBER(8)	NOT NULL,
pchannel_nb	NUMBER(8)	NOT NULL,
data_nb		NUMBER(8)	NOT NULL,
data_pchannel	NUMBER(8)	NOT NULL,
digi_type	VARCHAR2(3)	NOT NULL,
digi_polarity	VARCHAR2(1)	NOT NULL,
digi_channel	NUMBER(8)	NOT NULL,
ondate		DATE,
offdate		DATE,
lddate		DATE		DEFAULT (SYSDATE),
CONSTRAINT	StDiP00		PRIMARY KEY (sta, net, digi_nb, pchannel_nb, ondate),
CONSTRAINT	StDiP01		CHECK (data_nb >= 1),
CONSTRAINT	StDiP02		CHECK (data_pchannel >= 1),
CONSTRAINT	StDiP03		CHECK (digi_nb >= 1),
-- CONSTRAINT	StDiP04		CHECK (digi_type IN ('DSP','AUX')),
CONSTRAINT	StDiP05		CHECK (pchannel_nb >= 1)
) TABLESPACE	HT001;

CREATE TABLE Station_Datalogger (
sta		VARCHAR2(6)	NOT NULL,
net		VARCHAR2(8)	NOT NULL,
data_nb		NUMBER(8)	NOT NULL,
data_id		NUMBER(8)	NOT NULL,
nb_pchannel	NUMBER(8)	NOT NULL,
ondate		DATE,
offdate		DATE,
lddate		DATE		DEFAULT (SYSDATE),
CONSTRAINT	StDa00		PRIMARY KEY (sta, net, data_nb, ondate),
CONSTRAINT	StDa01		CHECK (data_nb >= 1),
CONSTRAINT	StDa02		CHECK (nb_pchannel >= 0)
) TABLESPACE	HT001;

CREATE TABLE Station_Datalogger_PChannel (
sta		VARCHAR2(6)	NOT NULL,
net		VARCHAR2(8)	NOT NULL,
data_nb		NUMBER(8)	NOT NULL,
pchannel_nb	NUMBER(8)	NOT NULL,
board_type	VARCHAR(1)	NOT NULL,
channel_type	VARCHAR(1)	NOT NULL,
seed_io		VARCHAR2(2)	NOT NULL,
nb_lchannel	NUMBER(8)	NOT NULL,
ondate		DATE,
offdate		DATE,
lddate		DATE		DEFAULT (SYSDATE),
CONSTRAINT	StDaP00		PRIMARY KEY (sta, net, data_nb, pchannel_nb, ondate),
CONSTRAINT	StDaP01		CHECK (data_nb >= 1),
CONSTRAINT	StDaP02		CHECK (nb_lchannel >= 1),
CONSTRAINT	StDaP03		CHECK (pchannel_nb >= 1),
CONSTRAINT	StDaP04		CHECK (board_type IN ('P', 'A', 'E', 'D')),
CONSTRAINT	StDaP05		CHECK (channel_type IN ('P', 'S'))
) TABLESPACE	HT001;

CREATE TABLE Station_Datalogger_LChannel (
sta		VARCHAR2(6)	NOT NULL,
net		VARCHAR2(8)	NOT NULL,
data_nb		NUMBER(8)	NOT NULL,
pchannel_nb	NUMBER(8)	NOT NULL,
lchannel_nb	NUMBER(8)	NOT NULL,
seqfil_id	NUMBER(8),
seedchan	VARCHAR2(3),
channel		VARCHAR2(3),
channelsrc	VARCHAR2(8),
location	VARCHAR2(2),
rgain		FLOAT,
rfrequency	FLOAT,
samprate	FLOAT		NOT NULL,
clock_drift	FLOAT,
flags		VARCHAR2(27),
data_format	VARCHAR2(80)	NOT NULL,
comp_type	NUMBER(8)	NOT NULL,
unit_signal	NUMBER(8)	NOT NULL,
unit_calib	NUMBER(8)	NOT NULL,
block_size	NUMBER(8)	NOT NULL,
ondate		DATE,
offdate		DATE,
remark		VARCHAR2(30),
lddate		DATE		DEFAULT (SYSDATE),
CONSTRAINT	StDaL00		PRIMARY KEY (sta, net, data_nb, pchannel_nb, lchannel_nb, ondate),
CONSTRAINT	StDaL01		CHECK (block_size >= 256 AND block_size <= 4096),
CONSTRAINT	StDaL02		CHECK (clock_drift >= 0.0),
CONSTRAINT	StDaL03		CHECK (data_nb >= 1),
CONSTRAINT	StDaL04		CHECK (lchannel_nb >= 1),
CONSTRAINT	StDaL05		CHECK (pchannel_nb >= 1),
CONSTRAINT	StDaL06		CHECK (rfrequency > 0.0)
) TABLESPACE	HT001;


--
-- Create the sequence numbers
--
DROP SEQUENCE	respseq;
DROP SEQUENCE	hpseq;
DROP SEQUENCE	lpseq;
DROP SEQUENCE	pzseq;
DROP SEQUENCE	pnseq;
DROP SEQUENCE	sensorseq;
DROP SEQUENCE	filampseq;
DROP SEQUENCE	dataseq;
DROP SEQUENCE	firseq;
DROP SEQUENCE	filterseq;
DROP SEQUENCE	seqfilseq;

CREATE SEQUENCE	respseq		INCREMENT BY 1	START WITH 1;
CREATE SEQUENCE	hpseq		INCREMENT BY 1	START WITH 1;
CREATE SEQUENCE	lpseq		INCREMENT BY 1	START WITH 1;
CREATE SEQUENCE	pzseq		INCREMENT BY 1	START WITH 1;
CREATE SEQUENCE	pnseq		INCREMENT BY 1	START WITH 1;
CREATE SEQUENCE	sensorseq	INCREMENT BY 1	START WITH 1;
CREATE SEQUENCE	filampseq	INCREMENT BY 1	START WITH 1;
CREATE SEQUENCE	dataseq		INCREMENT BY 1	START WITH 1;
CREATE SEQUENCE	firseq		INCREMENT BY 1	START WITH 1;
CREATE SEQUENCE	filterseq	INCREMENT BY 1	START WITH 1;
CREATE SEQUENCE	seqfilseq	INCREMENT BY 1	START WITH 1;

COMMIT;
EXIT;

