Sei sulla pagina 1di 2

REM

REM
REM
REM
REM

********************************************************************
First DROP all the tables
Then CREATE the tables and populate with the following information
The order of each column is mentioned in the schema
Boat(boat_id,name,type,capacity,price_seat,color)

insert into boat


insert into boat
insert into boat
REM CONSTRAINT 1
insert into boat
insert into boat

values('B100','Interlake','LUX',10,500,'yellow');
values('B200','Marine','CAR',15,300,'white');
values('B300','BlueSwan','CRU',30,100,'navy blue');
values('B400','Thunder','LAX',10,500,'yellow');
values('B400','BlueWhale','CAR',15,300,'blue');

REM Sailor(sailor_id,name,rating,dob)
insert into sailor
insert into sailor
insert into sailor
REM CONSTRAINT 2
insert into sailor
REM CONSTRAINT 4
insert into sailor

values('S100','Raman','A','01-OCT-80');
values('S200','Krishna','B','04-JUL-78');
values('S300','Govind','C','05-FEB-75');
values('S400','Ravi','D','06-APR-84');
values('S500','James','A','07-MAR-88');

REM Tourist(tourist_no,name,address,dob,phone)
insert
insert
insert
insert

into
into
into
into

tourist
tourist
tourist
tourist

values('T100','Bala','Chennai','07-MAR-80',9444843723);
values('T200','Kumar','Chengleput','08-MAR-75',9338254392);
values('T300','Vignesh','Trichy','09-DEC-83',9443476236);
values('T400','Vijay','Madurai','05-JAN-81',9854576432);

REM CONSTRAINT 5
insert into boat values('B100','Interlake','LUX',10,500,'yellow');
insert into sailor values('S100','Raman','A','01-OCT-80');
insert into tourist values('T100','Bala','Chennai','07-MAR-80',9444843723);
REM Reservation(boat_id,sailor_id,t_no,no_persons,reserve_date,sail_date)
insert into reservation
REM CONSTRAINT 3
insert into reservation
insert into reservation
REM CONSTRAINT 6
insert into reservation
insert into reservation
insert into reservation

values('B100','S100','T100',4,'15-DEC-10','31-DEC-10');
values('B100','S100','T200',6,'10-DEC-10','22-DEC-10');
values('B100','S100','T100',5,'10-DEC-10','25-DEC-10');
values('B100','S100','T400',7,'11-DEC-10','31-DEC-10');
values('B100','S100','T300',4,'12-DEC-10','10-JAN-11');
values('B200','S200','T300',3,'22-NOV-10','26-DEC-10');

REM CONSTRAINT 7
delete from boat where boat_id='B100';
delete from sailor where sailor_id='S100';
REM *********************************************************************
REM Include your ALTER DDL Statements
REM CONSTRAINT 8
desc reservation;
REM CONSTRAINT 9
desc tourist;

REM CONSTRAINT 10
insert into reservation values('B100','S100','T200',6,NULL,'22-DEC-10',2);
REM CONSTRAINT 11
desc tourist;
REM CONSTRAINT 12
insert into sailor values('S400','Ravi','D','06-APR-84');
REM CONSTRAINT 13
insert into boat values('B500','Thunder','LUX',10,500,'blue');
REM CONSTRAINT 14
insert into boat values('B600','Interlake','LUX',15,500,'yellow');
REM CONSTRAINT 15
select
delete
select
delete
select

* from reservation;
from boat where boat_id='B100';
* from reservation;
from sailor where sailor_id='S200';
* from reservation;

Potrebbero piacerti anche