0% found this document useful (0 votes)
74 views11 pages

VVP Engineering College: Assignment 1.1 Data Query Language

This document contains an assignment on data query language (DQL) with 19 questions requiring SQL queries to retrieve information from an EMP table. The questions cover basic SELECT queries with WHERE and ORDER BY clauses, filtering on dates, names, salaries and more. The submitted answers provide the necessary SQL queries to satisfy each question's requirements.

Uploaded by

Uugttt7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views11 pages

VVP Engineering College: Assignment 1.1 Data Query Language

This document contains an assignment on data query language (DQL) with 19 questions requiring SQL queries to retrieve information from an EMP table. The questions cover basic SELECT queries with WHERE and ORDER BY clauses, filtering on dates, names, salaries and more. The submitted answers provide the necessary SQL queries to satisfy each question's requirements.

Uploaded by

Uugttt7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

ASSIGNMENT 1.

1
DATA QUERY LANGUAGE

VVP
ENGINEERING
COLLEGE
CE DEPARTMENT

SUBMITTED BY: AAJUGIYA RAVI


BATCH = G3
ENROLLMENT NO.: 200470107072
Assignment 1

Assignment-1.1

1) List the Empno, Ename, Sal, Daily sal of all emps in the asc order of
Annsal
ANS: SELECT EMPNO, ENAME, SAL, SAL/30 DAILYSAL, SAL*12 ANNSAL
FROM EMP ORDER BY ANNSAL ASC

2) List the emps along with their Exp and Daily Sal is more than 100
ANS: SELECT * FROM EMP WHERE (SAL/30)>100 ORDER BY HIREDATE

200470107072 DQL 1
Assignment 1

3) List the emps who joined on 1-MAY-81,3-DEC-81,17-DEC-81,19-JAN-


80 in asc order of seniority
ANS: SELECT * FROM EMP WHERE HIREDATE IN ('05/01/1981',
'12/03/1981', '12/17/1981', '01/19/1980') ORDER BY HIREDATE DEC

4) List the emps Who Annual sal ranging from 22000 and 45000.
ANS: SELECT * FROM EMP WHERE SAL*12<45000 AND SAL*12>22000

200470107072 DQL 2
Assignment 1

5) List the Enames those are starting with ‘S’ and with five characters
ANS: SELECT * FROM EMP WHERE ENAME LIKE 'S '

6) List the emps those are having four chars and third character must
be ‘r’.
ANS: SELECT * FROM EMP WHERE ENAME LIKE ' R_'

200470107072 DQL 3
Assignment 1

7) List the Five character names starting with ‘S’ and ending with ‘H’.
ANS: SELECT * FROM EMP WHERE ENAME LIKE 'S H'

8) List the emps whose Sal is four digit number ending with Zero.
ANS: SELECT * FROM EMP WHERE SAL LIKE ' 0'

200470107072 DQL 4
Assignment 1

9) List the emps whose names having a character set ‘ll’ together
ANS: SELECT * FROM EMP WHERE ENAME LIKE '%LL%'

10) List the emps who does not belong to Deptno 20


ANS: SELECT * FROM EMP WHERE DEPTNO NOT LIKE 20

200470107072 DQL 5
Assignment 1

11) List all the emps except ‘PRESIDENT’ & ‘MGR” in asc order of
Salaries.
ANS: SELECT * FROM EMP WHERE JOB NOT IN ('PRESIDENT',
'MANAGER') ORDER BY SAL ASC

200470107072 DQL 6
Assignment 1

12) List the emps whose Empno not starting with digit 78
ANS: SELECT * FROM EMP WHERE EMPNO NOT LIKE '78 '

13) List all employees recruited in year 1981


ANS: SELECT * FROM EMP WHERE HIREDATE LIKE ' / /1981'

200470107072 DQL 7
Assignment 1

14) List all employees recruited in December


ANS: SELECT * FROM EMP WHERE HIREDATE LIKE '12%'

15) List employess who are Analyst, and their name contains 'A'
ANS: SELECT * FROM EMP WHERE JOB='ANALYST' AND ENAME LIKE
'%A%'

200470107072 DQL 8
Assignment 1

16) list employees based on their department seniority


ANS: SELECT DEPTNO,MIN(HIREDATE) SENIORITY FROM EMP GROUP
BY DEPTNO

17) LIST ALL CLERKS EXCEPT DEPARTMENT NO 10


ANS: SELECT * FROM EMP WHERE DEPTNO NOT IN (10) AND
JOB='CLERK'

200470107072 DQL 9
Assignment 1

18) list minimum salary of each department


ANS: SELECT MIN(SAL), DEPTNO FROM EMP GROUP BY DEPTNO

19) list latest date of recruitment of each department


ANS: SELECT MAX(HIREDATE), DEPTNO FROM EMP GROUP BY DEPTNO

200470107072 DQL 10

You might also like