CREATE TABLE Customer( CRN Varchar2(10) NOT null PRIMARY KEY, FirstName Varchar2(30) Not null, Lastname Varchar2

(30) , DOB Date Not null, Gender Varchar2(1) Not null, Email_Id Varchar2(50) Not null, MobNo Varchar2(12) Not null, HouseNo Varchar2(5) Not null, StreetName Varchar2(30) Not null, CityName Varchar2(30) Not null, State Varchar2(30) Not null, Pin Number(6) Not null, UserName Varchar2(15) Not null, Password Varchar2(15) Not null, Role Varchar2(10) Not null ); CREATE TABLE Account ( AccNo Varchar2(10) Not null PRIMARY KEY, CRN Varchar2(10) Not null, Acc_Type Varchar2(10) Not null, Balance number(10,2) Not null, Constraint fr_key_CRN foreign key(CRN) references Customer (CRN) on delete ca scade ); CREATE TABLE Transaction ( Trans_ID Varchar2(10) Not null PRIMARY KEY, From_Acc_No Varchar2(10) Not null, To_Acc_No Varchar2(10) Not null, Transaction_date Date Not null, Amount Number(10,2) Not null, Description Varchar2(40), constraint fr_key_froAcc foreign key(From_acc_no) references Account (AccNo) on delete cascade, constraint fr_key_toAcc foreign key(To_acc_no) references Account (AccNo) on del ete cascade); CREATE TABLE Payee( Payees_Accno Varchar2(10) Not null , Payers_Accno Varchar2(10) Not null , constraint fr_key_Payee foreign key(Payees_Accno) references Account (AccNo) on delete cascade, constraint fr_key_Payer foreign key(Payers_Accno) references Account (AccNo) on delete cascade, PRIMARY KEY (Payees_Accno, Payers_Accno));

Master your semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master your semester with Scribd & The New York Times

Cancel anytime.