EMP_NO NOT NULL NUMBER(4) EMP_NAME VARCHAR(25) DESIGNATION CHAR(4) JOINING_DATE DATE SALARY NUMBER(7,2) DEPT_NO NUMBER(2)
DEPT_NO NOT NULL NUMBER(2) DEPT_NAME VARCHAR(25) BUDGET NUMBER(15,2) MANAGER VARCHAR(25)
Create tables EMP, and DEPT, the structure for which are given above.
Write SQL queries for the following :
Display each employee‚??s name and date of joining.
Display employees earning more than Rs.5,000. Label the column name ‚??Employee‚??.
Display all employee names and employee numbers in the alphabetical order of names.
Display all employee names containing the letter ‚??S‚??.
Display the employees hired in 1981.
Display the minimum and maximum salary.
Display the list of employees along with their department name and its manager.
Display the number of different employees listed for each department.
Delete the records of all the employees hired in 1981 from EMP table.
Update the salary of all the employees to Rs. 10,000.
select EMPNAME, JOININGDATE from emp
select EMP_NAME as Employee from emp where SALARY>5000
select EMPNAME, EMPNO from emp order by EMP_NAME
select EMPNAME from emp where EMPNAME like "%ra%"
select EMPNAME from emp where YEAR(JOININGDATE)=1981
select min(SALARY), max(SALARY) from emp
select e.EMPNAME, d.DEPTNAME, d.MANAGER from emp e, dept d where e.DEPTNO=d.DEPTNO
select count(*), d.DEPTNAME from emp e, dept d where e.DEPTNO= d.DEPTNO group by e.DEPTNO
delete from emp where YEAR(JOINING_DATE)=1981
update emp set SALARY=10000;