CREATE TABLE CUSTOMER (CU_SSN CHAR (11) NOT NULL PRIMARY KEY, CU_NAME CHAR (30) NOT NULL, CU_ADDR1 CHAR (25) NOT NULL, CU_ADDR2 CHAR (25) NOT NULL, CU_ZIP CHAR (5) NOT NULL)
COMMENT ON TABLE CUSTOMER IS 'This is the customer table of the BANK data base'
COMMENT ON COLUMN CUSTOMER.CU_SSN IS 'customer social security number: table key'
COMMENT ON COLUMN CUSTOMER.CU_NAME IS 'customer name'
COMMENT ON COLUMN CUSTOMER.CU_ADDR1 IS 'street address'
COMMENT ON COLUMN CUSTOMER.CU_ADDR2 IS 'city / state'
COMMENT ON COLUMN CUSTOMER.CU_ZIP IS 'zip code - no extensions allowed'
CREATE TABLE NEWCUST (SSN CHAR (11) NOT NULL, NAME CHAR (30) NOT NULL, ADDR1 CHAR (25) NOT NULL, ADDR2 CHAR (25) NOT NULL, ZIP CHAR (5) NOT NULL)
COMMENT ON TABLE NEWCUST IS 'This is the newcust table of the BANK data base'
COMMENT ON COLUMN NEWCUST.SSN IS 'newcust social security number: table key'
COMMENT ON COLUMN NEWCUST.NAME IS 'newcust name'
COMMENT ON COLUMN NEWCUST.ADDR1 IS 'street address'
COMMENT ON COLUMN NEWCUST.ADDR2 IS 'city / state'
COMMENT ON COLUMN NEWCUST.ZIP IS 'zip code - no extensions allowed'
CREATE TABLE BOX (B_NUMB CHAR (3) NOT NULL, B_SIZE CHAR (1) NOT NULL, B_RENT DECIMAL (3,2) NOT NULL, B_SSN CHAR (11) , B_PAYUP CHAR (3) )
COMMENT ON TABLE BOX IS 'This is the box table of the BANK data base'
COMMENT ON COLUMN BOX.B_NUMB IS 'this is the safety deposit box number: table key'
COMMENT ON COLUMN BOX.B_SIZE IS 'this is the size of the box: S, M, or L'
COMMENT ON COLUMN BOX.B_RENT IS 'box rental amount per month'
COMMENT ON COLUMN BOX.B_SSN IS 'this is the associated customer ssn if the box is rented'
COMMENT ON COLUMN BOX.B_PAYUP IS 'shows what month the box is paid up for if rented'
CREATE TABLE CHECKING (C_ACCNUMB CHAR (8) NOT NULL PRIMARY KEY, C_STARTBAL DECIMAL (9,2) NOT NULL, C_ENDBAL DECIMAL (9,2) NOT NULL, C_SSN1 CHAR (11) NOT NULL, C_SSN2 CHAR (11) )
COMMENT ON TABLE CHECKING IS 'This is the checking table of the BANK data base'
COMMENT ON COLUMN CHECKING.C_ACCNUMB IS 'checking account number: table key'
COMMENT ON COLUMN CHECKING.C_STARTBAL IS 'starting balance of the checking account'
COMMENT ON COLUMN CHECKING.C_ENDBAL IS 'ending balance of the checking account'
COMMENT ON COLUMN CHECKING.C_SSN1 IS 'primary customer ssn associated with this checking account'
COMMENT ON COLUMN CHECKING.C_SSN2 IS 'optional: secondary customer ssn associated with this account'
CREATE TABLE CREDITS (CR_ACCNUMB CHAR (8) NOT NULL, CR_TRANDATE CHAR (8) NOT NULL, CR_DEPAMT DECIMAL (8,2) NOT NULL)
COMMENT ON TABLE CREDITS IS 'This is the credits table of the BANK data base'
COMMENT ON COLUMN CREDITS.CR_ACCNUMB IS 'associated checking account number: table key'
COMMENT ON COLUMN CREDITS.CR_TRANDATE IS 'credit transaction date'
COMMENT ON COLUMN CREDITS.CR_DEPAMT IS 'amount of deposit made to the checking account'
CREATE TABLE DEBITS (DB_ACCNUMB CHAR (8) NOT NULL, DB_TRANDATE CHAR (8) NOT NULL, DB_AMT DECIMAL (8,2) NOT NULL, DB_CHECKNO CHAR (5) NOT NULL)
COMMENT ON TABLE DEBITS IS 'This is the debits table of the BANK data base'
COMMENT ON COLUMN DEBITS.DB_ACCNUMB IS 'associated checking account number: table key'
COMMENT ON COLUMN DEBITS.DB_TRANDATE IS 'debit transaction date'
COMMENT ON COLUMN DEBITS.DB_AMT IS 'amount of the debit made from checking account'
COMMENT ON COLUMN DEBITS.DB_CHECKNO IS 'check number associated with the debit'
CREATE TABLE LOAN (L_NUMB CHAR (8) NOT NULL, L_TYPE CHAR (1) NOT NULL, L_RATE DECIMAL (4,2) NOT NULL, L_TERM SMALLINT NOT NULL, L_PAYMT DECIMAL (7,2) NOT NULL, L_BAL DECIMAL (8,2) NOT NULL, L_INTODAT DECIMAL (8,2) , L_SSN CHAR (11) NOT NULL, L_DESCRIP CHAR (25) NOT NULL, L_DATE DATE NOT NULL)
COMMENT ON TABLE LOAN IS 'This is the loan table of the BANK data base'
COMMENT ON COLUMN LOAN.L_NUMB IS 'loan number: table key'
COMMENT ON COLUMN LOAN.L_TYPE IS 'type of loan: M, A, P, H, or O'
COMMENT ON COLUMN LOAN.L_RATE IS 'loan interest rate'
COMMENT ON COLUMN LOAN.L_TERM IS 'term of loan in months'
COMMENT ON COLUMN LOAN.L_PAYMT IS 'amount of loan payment per month'
COMMENT ON COLUMN LOAN.L_BAL IS 'remaining balance of the loan'
COMMENT ON COLUMN LOAN.L_INTODAT IS 'interest paid to date'
COMMENT ON COLUMN LOAN.L_SSN IS 'associated customer ssn'
COMMENT ON COLUMN LOAN.L_DESCRIP IS 'description of the specific loan'
COMMENT ON COLUMN LOAN.L_DATE IS 'date the loan was initiated'
CREATE TABLE SAVINGS (S_ACCNUMB CHAR (8) NOT NULL, S_IRATE DECIMAL (4,2) NOT NULL, S_INTTOD DECIMAL (7,2) , S_BAL DECIMAL (9,2) NOT NULL, S_SSN CHAR (11) NOT NULL)
CREATE TABLE PERFDAT3 (CU_SSN CHAR(11) NOT NULL, CU_NAME CHAR(30) NOT NULL, CU_ADDR1 CHAR(25) NOT NULL, CU_ADDR2 CHAR(25) NOT NULL, CU_ZIP CHAR(5) NOT NULL,L_NUMB CHAR(8) NOT NULL, L_TYPE CHAR(1) NOT NULL, L_RATE DECIMAL(5,2) NOT NULL, L_TERM SMALLINT NOT NULL,L_PAYMT DECIMAL (7,2) NOT NULL, L_BAL DECIMAL(9,2) NOT NULL, L_INTODAT DECIMAL(9,2), L_DESCRIP CHAR(25) NOT NULL, L_DATE DATE, S_ACCNUMB CHAR(8) NOT NULL, S_IRATE DECIMAL(5,2) NOT NULL, S_INTTOD DECIMAL(7,2), S_BAL DECIMAL(9,2) NOT NULL, B_NUMB CHAR(3) NOT NULL, B_SIZE CHAR(1) NOT NULL, B_RENT DECIMAL(3,2) NOT NULL, B_PAYUP CHAR(3), C_ACCNUMB CHAR(8) NOT NULL, C_STARTBAL DECIMAL(9,2) NOT NULL, C_ENDBAL DECIMAL(9,2) NOT NULL)
CREATE TABLE PERFDAT4 (CU_SSN CHAR(11) NOT NULL, CU_NAME CHAR(30) NOT NULL, CU_ADDR1 CHAR(25) NOT NULL, CU_ADDR2 CHAR(25) NOT NULL, CU_ZIP CHAR(5) NOT NULL,L_NUMB CHAR(8) NOT NULL, L_TYPE CHAR(1) NOT NULL, L_RATE DECIMAL(5,2) NOT NULL, L_TERM SMALLINT NOT NULL,L_PAYMT DECIMAL (7,2) NOT NULL, L_BAL DECIMAL(9,2) NOT NULL, L_INTODAT DECIMAL(9,2), L_DESCRIP CHAR(25) NOT NULL, L_DATE DATE, S_ACCNUMB CHAR(8) NOT NULL, S_IRATE DECIMAL(5,2) NOT NULL, S_INTTOD DECIMAL(7,2), S_BAL DECIMAL(9,2) NOT NULL, B_NUMB CHAR(3) NOT NULL, B_SIZE CHAR(1) NOT NULL, B_RENT DECIMAL(3,2) NOT NULL, B_PAYUP CHAR(3), C_ACCNUMB CHAR(8) NOT NULL, C_STARTBAL DECIMAL(9,2) NOT NULL, C_ENDBAL DECIMAL(9,2) NOT NULL )
COMMENT ON TABLE SAVINGS IS 'This is the savings table of the BANK data base'
COMMENT ON COLUMN SAVINGS.S_ACCNUMB IS 'savings account number: table key'
COMMENT ON COLUMN SAVINGS.S_IRATE IS 'rate of interest paid'
COMMENT ON COLUMN SAVINGS.S_INTTOD IS 'interest earned to date'
COMMENT ON COLUMN SAVINGS.S_BAL IS 'savings account balance'
COMMENT ON COLUMN SAVINGS.S_SSN IS 'associated customer.ssn'