Consider the following tables EMPLOYEE and SALGRADE and answer (b) and (c) parts of this question:
(a) What do you understand by Selection and Projection operations in relational algebra ?
(b) Write SQL commands for the following statements :
1. To display the details of all EMPLOYEES in descending order of DOJ.
2. To display NAME and DESIGN of those EMPLOYEES, whose SAL-GRADE is either S02 or S03.
3. TO display the content Of all the EMPLOYEES table, whose DOJ is in between ’09-Feb-2006′ and ’08-Aug-2009′.
4. To add a new row with the following: 109, ‘HarishRoy’, ‘HEAD-IT’, ‘SOX, ’09- Sep-2007′, ’21-Apr-1983’
(c) Give the output of the following SQL queries :
1. SELECT COUNT(SGRADE), SGRADE FROM EMPLOYEE GROUP BY SGRADE;
2. SELECT MIN(DOB), MAX(DOJ) FROM EMPLOYEE;
3. SELECT NAME, SALARY FROM EMPLOYEE E, SAL-GRADE S WHERE E.SGRADE= S.SGRADE AND E.ECODE<103′;
4. SELECT SGRADE, SALARY +HRA FROM SALGRADE WHERE SGRADE =SGRADE=’S02;’