/*
-- crconstant.sql

-- version 1.0

-- SQL File to create the constants table

-- Programmed by Snehavadan Macwan

-- Last Update:		8  APRIL	1996, VERSION 1.0

-- ===========================================================================

The Constants Tables:

The constants tables contain sets of ascii values which are used to implement 
speciallized data types for different columns.  This is accomplished by having 
each column that requires a special data type reference the appropiate 
constant table as a foreign key.  The column will therefore be able to
take on any value that is in the referenced constant table, but no other.  
This is extremely useful where the same data type needs to be implemented on 
serveral different tables.

Every different datatype has its own table.  Each table consists of just one 
column, contianing all the different possible values for that datatype.  This
is done so that it is easier to add new values to a datatype in the future. 
The single column of every constant table is designated that tables primary
key.  This allows columns wich reference that table not to have specify a 
column name.  

In addition to creating each constant table, this script also adds an initial
set of values to each table.  

-- ===========================================================================
*/
-- Create the DETECTOR_TYPE constant definition.
/*
-- Table 		DETECTOR_TYPE

-- Number of Columns:	1

-- Primary Key:		DNAME

-- Description:

The DETECTOR_TYPE table constains a list of the different detectors for the
CDS instrument.
*/
CREATE TABLE detector_type
(
-- Table Constraints Follow 
-- Column Definitions Follow
dname		CHAR (1)	-- Detector Names	
	CONSTRAINT nn_dname_cn	NOT NULL
	CONSTRAINT pk_dname_cn	PRIMARY KEY
) ;
-- Add constant values to into DETECTOR_TYPE table.
INSERT INTO detector_type 	
	(dname) 	
	VALUES ('G') ;
INSERT INTO detector_type 	
	(dname) 	
	VALUES ('N') ;
INSERT INTO detector_type 	
	(dname) 	
	VALUES ('B') ;
