-- cal_calib_0_table_def.sql
--
-- Created:
--           Aug  2, 2004 Stan K.
--
-- Modified:
--
PROMPT Creating Table 'BLSES'
DROP TABLE BLSES
/
CREATE TABLE BLSES
 (BLS_ID NUMBER(38) NOT NULL
 ,CARD_ID NUMBER(38) NOT NULL
 )
/

PROMPT Creating Table 'BOXES'
DROP TABLE BOXES
/
CREATE TABLE BOXES
 (BOX_ID NUMBER(38) NOT NULL
 )
/

PROMPT Creating Table 'CARDS'
DROP TABLE CARDS
/
CREATE TABLE CARDS
 (CARD_ID NUMBER(38) NOT NULL
 ,CRATE_ID NUMBER(38) NOT NULL
 )
/

PROMPT Creating Table 'CHANNELS'
DROP TABLE CHANNELS
/
CREATE TABLE CHANNELS
 (CHANNEL_ID NUMBER(38) NOT NULL
 ,DEPTH_ID NUMBER(38)
 ,PDEPTH_ID NUMBER(38)
 ,TOWER_ID NUMBER(38) NOT NULL
 ,PTOWER_ID NUMBER(38) NOT NULL
 )
/

PROMPT Creating Table 'CRATES'
DROP TABLE CRATES
/
CREATE TABLE CRATES
 (CRATE_ID NUMBER(38) NOT NULL
 )
/

PROMPT Creating Table 'MBOARDS'
DROP TABLE MBOARDS
/
CREATE TABLE MBOARDS
 (MBOARD_ID NUMBER(38) NOT NULL
 ,BOX_ID NUMBER(38) NOT NULL
 )
/

PROMPT Creating Table 'PEDESTALS'
DROP TABLE PEDESTALS
/
CREATE TABLE PEDESTALS
 (MEAN_1 NUMBER
 ,MEAN_8 NUMBER
 ,SIGMA_1 NUMBER
 ,SIGMA_8 NUMBER
 ,ERROR_CODE NUMBER(38)
 ,CHANNEL_ID NUMBER(38) NOT NULL
 ,RUN_NUMBER NUMBER(38) NOT NULL
 )
/

PROMPT Creating Table 'PTOWERS'
DROP TABLE PTOWERS
/
CREATE TABLE PTOWERS
 (PTOWER_ID NUMBER(38) NOT NULL
 ,MBOARD_ID NUMBER(38) NOT NULL
 )
/

PROMPT Creating Table 'PULSERS'
DROP TABLE PULSERS
/
CREATE TABLE PULSERS
 (PATTERN_NUMBER NUMBER(38)
 ,PAR0_1 NUMBER
 ,PAR0_8 NUMBER
 ,PAR1_1 NUMBER
 ,PAR1_8 NUMBER
 ,ERROR_CODE NUMBER(38)
 ,CHANNEL_ID NUMBER(38) NOT NULL
 ,RUN_NUMBER NUMBER(38) NOT NULL
 )
/

PROMPT Creating Table 'RUNS'
DROP TABLE RUNS
/
CREATE TABLE RUNS 
 (RUN_TIME DATE
 ,RUN_TYPE NUMBER(38)
 ,NUMBER_OF_EVENTS NUMBER(38)
 ,CRATE_VALIDATION NUMBER(38)
 ,RUN_NUMBER NUMBER(38) NOT NULL
 )
/

PROMPT Creating Table 'TOWERS'
DROP TABLE TOWERS
/
CREATE TABLE TOWERS
 (TOWER_ID NUMBER(38) NOT NULL
 ,BLS_ID NUMBER(38) NOT NULL
 )
/
