You are on page 1of 4

drop

drop
drop
drop
drop
drop

table
table
table
table
table
table

tbl_nsepemployee;
tbl_bank;
tbl_college;
tbl_student;
tbl_transactions;
tbl_nsepaccount;

create table tbl_nsepemployee (empid varchar2(20) not null primary key,name varc
har2(20) not null,role varchar2(20) not null,phone varchar2(20) not null,usernam
e varchar2(20) not null,password varchar2(100) not null,securityquestion varchar
2(50) not null,securityanswer varchar2(20) not null);

insert into tbl_nsepemployee values (521511,'Ramachandra','clerk','9885690721','


Rama', '49bb197bec17b7d20b2df6b1f3c3434a','Last name', 'Reddy');
insert into tbl_nsepemployee values (521582,'Sudheendra','manager','9025241369',
'Sudhy', 'c3be704e3ef9d061214039976b1f1795','what is your home town','Madanapall
i');
insert into tbl_nsepemployee values(521586,'Naga Bhushnam','manager','9043555545
5','Bhushanam','49bb197bec17b7d20b2df6b1f3c3434a','Surname is','Thalla');
create table tbl_bank (BANKID NUMBER(10) PRIMARY KEY NOT NULL,
BANKNAME VARCHAR2(30) NOT NULL,
BRANCH VARCHAR2(30) NOT NULL,
ADDRESS VARCHAR2(50) NOT NULL,
PHONENUMBER NUMBER(15) NOT NULL);
INSERT INTO tbl_bank
INSERT INTO tbl_bank
898989);
INSERT INTO tbl_bank
INSERT INTO tbl_bank
2432);
INSERT INTO tbl_bank
ennai',9234353343);
INSERT INTO tbl_bank
INSERT INTO tbl_bank
INSERT INTO tbl_bank

values(63245, 'HDFC','Karapakam','Chennai',9098998990);
values(63246, 'Kotak Mahindra Ltd','T.Nagar','Chennai',9889
values(63247, 'ICICI','Chetpet','Chennai',9079923424);
values(63248, 'Ing Vysa Bank','Anna Nagar','Chennai',974324
values(63249, 'Tamil Nadu Mercentaile Bank','K.K.Nagar','Ch
values(63250, 'Axis Bank','Saidapet','Chennai',9000566777);
values(63251, 'UCO Bank','J.J.Nagar','Chennai',9893333367);
values(63252, 'HSBC','Alwarpet', 'Chennai',9000000333);

create table tbl_college (collegeid number(10) not null primary key,


collegename varchar2(20) not null,
collegeauthority varchar2(20) not null,
collegeaddress varchar2(50) not null);
insert
insert
insert
insert
nai');
insert
;
insert
insert

into
into
into
into

tbl_college
tbl_college
tbl_college
tbl_college

values
values
values
values

(73456,'IIT','IIT Chennai','Chennai');
(73457,'SRM','SRM University','Chennai');
(73458,'VIT','Vellore University','Chennai');
(73459,'Sathyabama','Sathyabama University','Chen

into tbl_college values (73460,'Pondycheri','Pondy University','Chennai')


into tbl_college values (73461,'T.J College','T.J University','Chennai');
into tbl_college values (73462,'Vellimai','SRM University','Chennai');

create table tbl_student (studentid number(10) primary key not null,


firstname varchar2(30) not null,
lastname varchar2(30) not null,
age number(3) not null,
address varchar2(50) not null,
phone varchar2(20) not null,
email varchar2(20) not null,
collegeid number(10) not null references tbl_college(COLLEGEID),
yearofstudy number(3) not null,
bankid number(20) not null references tbl_bank(BANKID) ,
bankaccountid number(20) not null,
committedamount number(25,2) not null);
insert into tbl_student values (23459,'Sudheendara','Kumar',20,'Chennai','902524
1369','sudy@gmail.com',73456,1,63245,11008281072123,3000);
insert into tbl_student values(23460,'Keertam','Raj',21,'Chennai','90233243249',
'keetam@gmail.com',73457,2,63246,23423423432444,4000);
insert into tbl_student values(23461,'Raj','Kumar',22,'Chennai','92342342342','r
aj@gmail.com',73458,2,63247,23465456456,4000);
insert into tbl_student values(23462,'Sukumar','Joshi',23,'Chennai','92342342344
3','sukumar@gmail.com',73461,3,63250,234654564543,6000);
insert into tbl_student values(23463,'Anil','Sharma',20,'Chennai','923324342342'
,'anil@gmail.com',73460,1,63251,234654563453,1000);
create table tbl_transactions (transactionid number(20) not null primary key,
accountid number(30) not null,
studentid number(10) not null,
transactiondate date not null,
amount number(25,2) not null,
depositbank varchar2(30) not null,
approvetransaction number(1) not null );
CREATE SEQUENCE TRANSACTION_SEQUENCE START WITH 900021 INCREMENT BY 1;
insert into tbl_transactions values (12346, 11008281072, 23456, to_date(current_
date, 'dd/mm/yyyyy'),3000,'0');
create table tbl_nsepaccount(nsepaccountid number(20) not null primary key,
studentid number(30) not null references tbl_student(STUDENTID),
startdate date not null,
enddate date not null,
accounttype varchar2(20) not null,
currentbalance number(25,2) not null,
createdby varchar2(20) not null,
createddate date not null,
bonus number(25,2) not null,approved number(1));
CREATE SEQUENCE ACCOUNT_SEQUENCE START WITH 200021300 INCREMENT BY 1;
update tbl_student set committedamount=3000 where studentid=23463;
insert into tbl_nsepaccount values(ACCOUNT_SEQUENCE.nextval,23463,to_date('01/de
c/2010','dd/mm/yyyy'),to_date('11/jan/2013','dd/mm/yyyy'),'RD',0,521511,to_date(
'21/jan/2010','dd/mm/yyyy'),0,1)
insert into tbl_nsepaccount values(ACCOUNT_SEQUENCE.nextval,23462,to_date('20/ja
n/2011','dd/mm/yyyy'),to_date('20/jan/2013','dd/mm/yyyy'),'RD',0,521511,to_date(
'21/jan/2010','dd/mm/yyyy'),0,1)

create table tbl_bonus(studentid number(20),transactiondid number(30),monthyear


date,monthbonus number(20,2),quaterlybonus number(20,2),annualbonus number(20,2)
);

insert into tbl_transactions values(TRANSACTION_SEQUENCE.nextval,'234654563453',


'23463',to_date('10/01/2011','dd/mm/yyyy'),'3000','HDFC','1');
insert into tbl_transactions values(TRANSACTION_SEQUENCE.nextval,'234654563453',
'23463',to_date('10/02/2011','dd/mm/yyyy'),'3000','HDFC','1');
insert into tbl_transactions values(TRANSACTION_SEQUENCE.nextval,'234654563453',
'23463',to_date('10/03/2011','dd/mm/yyyy'),'3000','HDFC','1');
insert into tbl_transactions values(TRANSACTION_SEQUENCE.nextval,'234654563453',
'23463',to_date('10/04/2011','dd/mm/yyyy'),'3000','HDFC','1');
insert into tbl_transactions values(TRANSACTION_SEQUENCE.nextval,'234654563453',
'23463',to_date('10/05/2011','dd/mm/yyyy'),'3000','HDFC','1');
insert into tbl_transactions values(TRANSACTION_SEQUENCE.nextval,'234654563453',
'23463',to_date('10/06/2011','dd/mm/yyyy'),'3000','HDFC','1');
insert into tbl_transactions values(TRANSACTION_SEQUENCE.nextval,'234654563453',
'23463',to_date('10/07/2011','dd/mm/yyyy'),'3000','HDFC','1');
insert into tbl_transactions values(TRANSACTION_SEQUENCE.nextval,'234654563453',
'23463',to_date('10/08/2011','dd/mm/yyyy'),'3000','HDFC','1');
insert into tbl_transactions values(TRANSACTION_SEQUENCE.nextval,'234654563453',
'23463',to_date('10/09/2011','dd/mm/yyyy'),'3000','HDFC','1');
insert into tbl_transactions values(TRANSACTION_SEQUENCE.nextval,'234654563453',
'23463',to_date('10/10/2011','dd/mm/yyyy'),'3000','HDFC','1');
insert into tbl_transactions values(TRANSACTION_SEQUENCE.nextval,'234654563453',
'23463',to_date('10/11/2011','dd/mm/yyyy'),'3000','HDFC','1');
insert into tbl_transactions values(TRANSACTION_SEQUENCE.nextval,'234654563453',
'23463',to_date('10/12/2011','dd/mm/yyyy'),'3000','HDFC','1');
insert into tbl_transactions values(TRANSACTION_SEQUENCE.nextval,'234654563453',
'23462',to_date('15/01/2011','dd/mm/yyyy'),'6000','Axis Bank','1');
insert into tbl_transactions values(TRANSACTION_SEQUENCE.nextval,'234654563453',
'23462',to_date('15/02/2011','dd/mm/yyyy'),'6000','Axis Bank','1');
insert into tbl_transactions values(TRANSACTION_SEQUENCE.nextval,'234654563453',
'23462',to_date('15/03/2011','dd/mm/yyyy'),'6000','Axis Bank','1');
insert into tbl_transactions values(TRANSACTION_SEQUENCE.nextval,'234654563453',
'23462',to_date('15/04/2011','dd/mm/yyyy'),'5000','Axis Bank','1');
insert into tbl_transactions values(TRANSACTION_SEQUENCE.nextval,'234654563453',
'23462',to_date('15/05/2011','dd/mm/yyyy'),'5000','Axis Bank','1');
insert into tbl_transactions values(TRANSACTION_SEQUENCE.nextval,'234654563453',
'23462',to_date('15/06/2011','dd/mm/yyyy'),'5000','Axis Bank','1');
insert into tbl_transactions values(TRANSACTION_SEQUENCE.nextval,'234654563453',
'23462',to_date('15/07/2011','dd/mm/yyyy'),'3000','Axis Bank','1');
insert into tbl_transactions values(TRANSACTION_SEQUENCE.nextval,'234654563453',
'23462',to_date('15/08/2011','dd/mm/yyyy'),'3000','Axis Bank','1');
insert into tbl_transactions values(TRANSACTION_SEQUENCE.nextval,'234654563453',
'23462',to_date('15/09/2011','dd/mm/yyyy'),'3000','Axis Bank','1');
insert into tbl_transactions values(TRANSACTION_SEQUENCE.nextval,'234654563453',
'23462',to_date('15/10/2011','dd/mm/yyyy'),'6000','Axis Bank','1');
insert into tbl_transactions values(TRANSACTION_SEQUENCE.nextval,'234654563453',
'23462',to_date('15/11/2011','dd/mm/yyyy'),'6000','Axis Bank','1');
insert into tbl_transactions values(TRANSACTION_SEQUENCE.nextval,'234654563453',
'23462',to_date('15/12/2011','dd/mm/yyyy'),'6000','Axis Bank','1');

select s.studentid, n.nsepaccountid,s.committedamount,tr.amount,tr.transactionda


te from tbl_student s,tbl_nsepaccount n,tbl_transactions tr where s.studentid=tr
.studentid and s.studentid=n.studentid and s.studentid='23463' and tr.approvetra
nsaction='1';

You might also like