Professional Documents
Culture Documents
209 - Akash Baranwal - 01
209 - Akash Baranwal - 01
1.Make your own student table with certain necessary facts, like your id, name and
Branch.
insert all into student values(1,'manish', 'CSE') into student values (2,'rohit','CSE') into
student values (3,'saurabh','CSE') into student values (4,'adarsh','CSE') into student values
(5,'anisha','CSE') into student values (6,'amardeep','CSE') into student values
(7,'mrinal','CSE') select * from dual;
3. It sounds good if you say roll instead of id. so, change it.
alter table student rename column id to roll;
4. Here, I think age and address could also be added. So, append it with default address of
all students as Kolkata.
6. How do I identify each student uniquely? So make roll number as your primary key.
9. Identify the students who have passed the exam. Cut off marks is 50%.
select roll, name, marks from student where marks >50;
10. If any student fails, discard his record from the database.
14. Show salary statement along with name of all employees whose salary>1000.
15. How many such employees are there whose salary is within 1000 to 3000 range?
Select count(emp_name) from new where salary between 1000 and 3000;
16. Give a pay hike to the employees whose salary is 1250 and 950.
update new set hike=0.3*salary where salary between 950 and 1250;
19. Give a salary hike of 15% to the employees who have joined the company before 31st
Dec 1981.
update new set hike=hike + 0.15*salary where date_of_joining<'31-DEC-81' ;
update new set salary=salary+hike where date_of_joining<'31-DEC-81' ;