2021uci6516 Dbmsfile
2021uci6516 Dbmsfile
2021uci6516 Dbmsfile
SYSTEMS
PRACTICAL FILE
(CICPC05)
TEACHER’S SIGNATURE
Ques1) Consider the following relational schema :
INSERT INTO boats VALUES (11, 'boat1', 'red'); INSERT INTO boats VALUES (12,
'boat2', 'blue'); INSERT INTO boats VALUES (13, 'boat3', 'green');INSERT INTO
boats VALUES (14, 'boat4', 'yellow'); INSERT INTO boats VALUES (15, 'boat5',
'pink'); INSERT INTO boats VALUES (16, 'boat6', 'orange');INSERT INTO boats
VALUES (17, 'boat7', 'green');INSERT INTO boats VALUES (18, 'boat8', 'black');
INSERT INTO boats VALUES (19, 'boat9', 'red'); INSERT INTO boats VALUES (20,
'boat10', 'blue');
b) Find names of sailors who’ve reserved a red or a greenboat in the month of March.
e) Find sailors whose rating is greater than that of all thesailors named “John”
Relational Algebra of Q1
Ques 2) Consider the following relational schema:
insert into customer values(11 , 'Rohan' , 'Singh' , 5000);insert into customer values(12 ,
'Ronak' , 'Godara' , 8000);insert into customer values(13 , 'Atharav' , 'Mahajan' ,40000);
insert into customer values(14 , 'Ishan' , 'Mehta' , 10000);insert into customer values(15 , 'Virat'
, 'Kohli' , 9000); insert into customer values(16 , 'Tanishq' , 'Mehta' ,12000);
insert into customer values(17 , 'Justin' , 'Timberlake' ,20000);
insert into customer values(18 , 'Taylor' , 'Swift' , 50000);insert into customer values(19 , 'Rock'
, 'Bottom' , 5000);insert into customer values(20 , 'Tyler' ,'woods' , 0);
b) Write the trigger to update the CUST_BALANCE in theCUSTOMER table when a new
invoice record
is entered for the customer.
c) Find the customers who have purchased more thanthree units of a product in a day.
d) Write a query to illustrate Left Outer, Right Outer andFull Outer Join.
left:
right:
Full:
f) Write a trigger to ensure that no employee of age lessthan 25 can be inserted in the
database.