
EMP
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
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;
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.