Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

1.

Display all the details of those employees whose dept_id is D12 and
whose salary is more than 5000.

2. Write a query to display details of all the employees except those


whose dept_id number is D01 or D02.

3.Write a query to display the details of all those employees whose


salary is unknown.

4.Write a query to display details of all employees who have been given
a salary (i.e., salary is not null) and works in the department D1.

5. Write a query to display details of all those employees whose name


starts with ‘M’.

6.Write a query to display details of all those employees whose name


ends with ‘L’.

7.Write a query to display details of all those employees whose name


contains ‘A’.

8.Write a query to display details of all those employees whose name is


of 4 characters and start with ‘A’.

9.Write a query to display names of all employees containing ‘se’ as a


substring in name.

10.Write a command to delete a record of an employee from employee


table whose salary is more than 100000.
Ans.

1. Select * from employee where dept_id = “D12” and Salary > 5000;

2. Select * from employee where dept_id not in (“D01”, “D02”);

3. Select * from employee where salary is null;

4. Select * from employee where salary is not null and dept_id = “D1”;

5. Select * from Employee where ename like “M%”;

6. Select * from Employee where ename like “%L”;

7. Select * from Employee where ename like “%A%”;

8. Select * from employee where ename like “A_ _ _”;

9. Select * from employee where ename like “%se%”;

10. Delete from employee where salary > 100000;

You might also like