Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
3 views1 page

Mysql Revision Questions

The document contains SQL queries for two tables: EMPLOYEE and Worker. It includes queries to select distinct job titles, employee details based on salary conditions, and worker information filtered by salary and department. Additionally, it provides queries to display names, joining dates, and total counts of workers in specific departments.

Uploaded by

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

Mysql Revision Questions

The document contains SQL queries for two tables: EMPLOYEE and Worker. It includes queries to select distinct job titles, employee details based on salary conditions, and worker information filtered by salary and department. Additionally, it provides queries to display names, joining dates, and total counts of workers in specific departments.

Uploaded by

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

1.

Write output based on the Table EMPLOYEE

EMPNO ENAME JOB SAL COMMISSION


8369 SMITH CLERK 10000 NULL
8499 ANYA SALESMAN 15000 5000
8521 SETH SALESMAN 15000 1000
8701 VIKAS CLERK 8000 500
8566 MAHDEVAN MANAGER 25000 7500
8654 SCOTT PRESIDENT 45000 5000
i SELECT DISTINCT JOB FROM EMPLOYEE;

ii SELECT EMPNO, ENAME FROM EMPLOYEE WHERE EMPNO <8566;

iii SELECT * FROM EMPLOYEE WHERE SAL =15000 OR SAL=8000;

iv SELECT ENAME, JOB, SALARY FROM EMPLOYEE WEHRE ENAME LIKE ‘S%’ ;

2. Write SQL query for the questions that follow based on given table Worker

Worker_ID Name Salary Joining_Date Department


001 Monika 10000 2014-02-20 HR
002 Shiksha 8000 2014-06-11 Admin
003 Arun 30000 2014-02-20 HR
004 Nishant Null 2014-02-20 Admin
005 Vivek 15000 2014-06-11 Admin
006 Santosh 20000 2014-01-20 Accountant
007 Naresh 7500 2014-04-11 Accountant
(a) To display Name and joining date of workers whose salary is greater than 10000.

(b) To display details of those workers whose name started with ‘N’.

(c) To display all worker details from worker table order by Name ascending.

(d) To display Name and Salary of those workers who works in ‘HR’ or ‘Admin’ Department.

(e) To display the total number of workers who work in Accountant department

(f) To get the below output

Department
HR
Admin
Accountant

(g) To get the below output

Salary
10000
8000
30000
15000
20000
7500

You might also like