Example:-3
1.Consider the following table Employee (E_No, E_Name, Salary, DOJ, Qualification) and answer the following queries:
I.Insert at least five records into the
table.
II.Update the salary of employee to 50000
whose E_No is 1.
III.Delete the details of employee whose E_No
is 5.
IV.Update the Qualification of employee to
“MCS NET” whose name is Mr. Satyavan.
V.Update the salary of employee to 40000
whose qualification is “MCS NET” and Name is “Ajay”.
I.Create table Employee (E_No int primary
key, E_Name varchar(10), Salary int, DOJ varchar(10), Qualification
varchar(50));
Insert into Employee values (1, ‘Sudheer’,
35000, ‘20.04.2014’, ‘MCA’);
Commit;
Select * from Employee;
II.Update Employee set Salary = 50000 where
E_No=1;
III.Delete from Employee where E_No=5;
IV.Update Employee set Qualification = ‘MCS
NET’ where E_Name = ‘Satyavan’;
V.Update Employee set Salary = 40000 where
Qualification = ‘MCS NET’ and Name = ‘Ajay’;
2.Consider the following table Hospital
(H_No, H_Name, Addr, Est_Year, Specialty) and answer the following
queries:
I.Insert at least five records into the
table.
II.Update an address of hospital to “Pimpri
Gurav” whose name is “Birla”.
III.Update the specialty of hospital to
“Multi” whose established year is between 1990 to 2000.
IV.Delete the details of hospital whose
address id “Pimpri”.
I.Create table Hospital (Hospital_No int primary key, Hospital_Name varchar(10), Address varchar(10), Established_Year int, Speciality varchar (10));
Insert into Hospital values (1, 'KEM', 'Rasta Peth', 1992, 'Muli');
Commit;
Select * from Hospital;
II.Update Hospital set Address = 'Pimpri
Gurav' where Hospital_Name = 'Birla';
III.I.Update Hospital set Speciality =
'Multi' where Established_Year between 1990 and 2000;
IV.Delete from Hospital where Address =
‘Pimpri’;
3.Consider the following table Student (Roll_No, Name, Class, DOB, College) and answer the following queries:
I.Insert at least ten records into the table.
II.Update the class of student to “TY” whose
birth date is ‘18.03.1999’.
III.Delete the details of student whose
college is “Dr. D Y Patil”.
IV.Update the college of student to “Dr. D Y
Patil” whose name is “Yash”.
I.Create table Student (Roll_No int primary
key, Name varchar(10), Class int, Date_of_Birth varchar(10), College
varchar(50));
Insert into Student values (1, ‘Harsh’, ‘FY BCA’, ‘19.05.2002’, ‘Foresight College of Commerce’);
Commit;
Select * from Student;
II.Update Student set Class = ‘TY’ where
Date_of_Birth = ‘18.03.1999’;
III.Delete from Student where College = ‘Dr.
D Y Patil’;
IV.Update Student set College = ‘Dr. D Y
Patil’ where Name = ‘Yash’;