OK - another question for some group wisdom..

Having created the second cut of the schema for the database:
tutorial_example_clinic.odb

The decision is now about lookup tables - To use an integer ID or not...

For instance here are two lookup tables:

-- PhoneType is a lookup table
-- for use in FK relations to
-- PatientPhone and TherapistPhone
-- tables
--
CREATE TABLE "PhoneType" (
"PhoneDesc" VARCHAR(10) NOT NULL PRIMARY KEY
);

-- Initial data for PhoneType table
--
INSERT INTO "PhoneType" VALUES ( 'Home' );
INSERT INTO "PhoneType" VALUES ( 'Work' );
INSERT INTO "PhoneType" VALUES ( 'Cell' );
INSERT INTO "PhoneType" VALUES ( 'FAX' );

-- TransactionType is a lookup table
-- used by the patient billing
-- funcitons
-- It is referecned as a FK
-- from the Account table
--
CREATE TABLE "TransactionType" (
"Tran_Type_ID" INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 0) NOT NULL PRIMARY KEY,
"Tran_Desc" VARCHAR(50)
"Debit" CHAR(6) NOT NULL,
CONSTRAINT CK_DBT CHECK("Debit" IN ('DEBIT', 'CREDIT'))
);

--
-- Intial values for TransactionType
-- table
--
INSERT INTO "TransactionType" ("Tran_Desc", "Debit" ) VALUES( 'Session', 'DEBIT' ); INSERT INTO "TransactionType" ("Tran_Desc", "Debit" ) VALUES( 'Missed Session', 'DEBIT' ); INSERT INTO "TransactionType" ("Tran_Desc", "Debit" ) VALUES( 'Payment', 'CREDIT' ); INSERT INTO "TransactionType" ("Tran_Desc", "Debit" ) VALUES( 'Returned Payment', 'DEBIT' );


So - the question - ID or not to ID.

Whichever way, it will be made consistent. Anyone want to way in on which way to show as the better choice?

Thanks

Drew

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to