The document describes a table called EMP with columns like EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO. It then lists 22 questions to query data from this EMP table. The questions ask to display various columns for employees that meet certain criteria like department, salary range, name etc and perform operations like updates.
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
236 views
Assignment SQL 4
The document describes a table called EMP with columns like EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO. It then lists 22 questions to query data from this EMP table. The questions ask to display various columns for employees that meet certain criteria like department, salary range, name etc and perform operations like updates.
2. Display employee number, name and salary of all employee. 3. Display employee no., name and 10% of salary for each emplaoyee for earthquake fund who joined before 2001. 4. To display the detail of employees whose salary is not more than 15000. 5. Display name and salary of all employees whose salary is greater then equal to 20000. 6. Display employee no and name of employees whose deptno is 30 and salary more than 15000. 7. Display the employee name either ‘Sumit Vats’ or ‘Chetan Gupta’. 8. Display all the information except ‘Jagdish Rana’. 9. Display the detail of employees whose commission is NULL. 10.Display distinct department from the table. 11.Display employee no., name and salary of all employees whose salary between 15000 and 20000. 12.To display employee no., name and job of employees whose employee no. 7876, 7839, 7788, 7566. 13.Display employee no. and name whose name start alphabet ‘S’. 14.Display employee no, name and salary of employees whose name ‘s second character is ‘a’. 15.Display employee no, name and salary of employees whose name ‘s second last character is ‘n’. 16.Display employee no, name and salary of employees whose name ‘s last character is ‘a’. 17.Display employee no, name and salary of employees whose name ‘s contain ‘i’. 18.Display employee no., name except 7788, 7839, 7900. 19.Display all the employee no and name whose commission is not NULL. 20.Display employee no and name whose salary is not in between 15000 and 20000. 21.Display employee no., name and annual salary of all employee. Annual salary will be calculated as salary into 12. Use column alias. 22.Write a query to update all the records with an increment of RS. 500 whose salary is less than 15000.