Dbms
Dbms
10060
1.create the EMP and DEPT tables with appropriate constraints by using query.
create table dep
e_name text);
e_name text,
commission number,
salary number,
hir_date date,
2.inseart at leaste 30 records in EMP table and 5 records in DEPT table by using query.
INSERT INTO dep
pg. 1
roll no. 10060
alter table emp
FROM emp
WHERE d_no=105;
10. find the employees whose commission is greter than their salary.
SELECT *
FROM emp
WHERE commission>salary;
11. find the employees whose commission is greter than 40% of their salary.
SELECT *
FROM emp
WHERE commission>salary*(40/100);
pg. 2
roll no. 10060
12. find the employees whose commission is less than 40% of their salary.
SELECT *
FROM emp
WHERE commission<=salary*(40/100);
13. find all salesman in department 30 whose salary is gretar than or equal to rs 1500.
SELECT *
FROM emp
FROM emp
FROM emp
SELECT *
FROM emp
17. find the detail of all ‘manager’ (work in any department) and
SELECT *
FROM emp
SELECT *
FROM emp
SELECT *
FROM emp
WHERE comission=0;
20. find the employe whose name begning letter ‘m’ and end with ‘n’.
SELECT *
FROM emp
21. find the employee whose name are five character long and ends with ‘a’.
SELECT *
FROM emp
22. find the all employee who have hired in the month February of any year.
Where format(hir_date,’mn’)=2;
Select left(name,5)
24. for each employee display the no of month passed since the employee join the company.
From emp;
pg. 4
roll no. 10060
25.display the name of employee shorted their names.
SELECT *
FROM emp
ORDER BY e_name;
26. display the name , job and salary of all employee shorted on job and salary in descending order.
FROM emp
DELETE *
FROM emp
29. give the commission rs 500 to all employee whose salary less than rs 5000.
WHERE salary<5000;
SELECT *
FROM emp
SELECT *
FROM emp
pg. 5
roll no. 10060
32. list the total no of employee in company.
SELECT count(e_no)
FROM emp;
33. find the detail of employe who are working in a/c department and sett higher salary.
where dep_name=’account’);
SELECT *
FROM emp
WHERE hir_date=#1/1/1999#;
35. list the name , job, salary of emp in department who earn more than rs 5000.
FROM emp
WHERE salary>=5000;
pg. 6