Professional Documents
Culture Documents
Institute of Engineering & Management
Institute of Engineering & Management
INSTITUTE OF ENGINEERING
&
MANAGEMENT
SIGNATURE :
DATE: 21.04.2021
1.Make your own student table with certain necessary facts, like your id, name and
Branch.
SQL> insert all into student values (1,'Manish','CSE') into student values (2,'Akash','CSE') into student values
(3,'Shivam','CSE') into student values (4,'Abhinaw','CSE') into student values (5,'Ajay','ECE') select * from dual;
3. It sounds good if you say roll instead of id. so, change it.
4. Here, I think age and address could also be added. So, append it with default address of
SQL> alter table student add (age int, address varchar2(50) default('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%.
SQL> 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.
SQL> 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.
SQL> 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.
SQL> update new set salary= salary+hike where date_of_joining < '31-DEC-81';