The document outlines the structure and records of two tables, EMP and DEPT, used in SQL assignments. It includes specific SQL queries for retrieving employee information based on various criteria such as job titles, hire dates, and department affiliations. The assignments aim to enhance understanding of SQL operations and data manipulation within the given tables.
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
2 views
DBMS Assignment-3-DKP-final
The document outlines the structure and records of two tables, EMP and DEPT, used in SQL assignments. It includes specific SQL queries for retrieving employee information based on various criteria such as job titles, hire dates, and department affiliations. The assignments aim to enhance understanding of SQL operations and data manipulation within the given tables.
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2
SQL Assignments
EMP Table Structure:
Name Null? Type
EMPNO NOT NULL NUMBER(4), Primary Key
ENAME VARCHAR2(10) JOB VARCHAR2(9) MGR NUMBER(4) HIREDATE DATE SAL NUMBER(7,2) COMM NUMBER(7,2) DEPTNO NUMBER(2) foreign key of DEPT table
Records in EMP Table
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7369 SMITH CLERK 7902 17-DEC-80 800 20
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30 7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30 7566 JONES MANAGER 7839 02-APR-81 2975 20 7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30 7698 BLAKE MANAGER 7839 01-MAY-81 2850 30 7782 CLARK MANAGER 7839 09-JUN-81 2450 10 7788 SCOTT ANALYST 7566 19-APR-87 3000 20 7839 KING PRESIDENT 17-NOV-81 5000 10 7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30 7876 ADAMS CLERK 7788 23-MAY-87 1100 20 7900 JAMES CLERK 7698 03-DEC-81 950 30 7902 FORD ANALYST 7566 03-DEC-81 3000 20 7934 MILLER CLERK 7782 23-JAN-82 1300 10
DEPT Table Structure:
Name Null? Type
DEPTNO NOT NULL NUMBER(2), Primary key
DNAME VARCHAR2(14) LOC VARCHAR2(13)
Records in DEPT Table:
DEPTNO DNAME LOC
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS 30 SALES CHICAGO 40 OPERATIONS BOSTON Assignment #03
1. List the names of analyst and salesmen.
2. List details of employees who have joined before 30 Sep 81. 3. List names of employees who are not managers. 4. List the names of employees whose employee numbers are 7369, 7521, 7839, 7934, 7788. 5. List employees not belonging to department 30, 40, or 10. 6. List employee names for those who have joined between 30 June and 31 Dec. ‘81. 7. List the different designations in the company. 8. List the names of employees who are not eligible for commission. 9. List the employees not assigned to any department. 10. List the employees who are eligible for commission. 11. List employees whose names either start or end with “S”. 12. List names of employees whose names have “i” as the second character. 13. List the number of employees working with the company. 14. List the number of designations available in the EMP table. 15. List the total salaries paid to the employees. 16. List the maximum, minimum and average salary in the company. 17. List the maximum salary paid to a salesman.