SlideShare a Scribd company logo
ACE-Pali/DBMS/PRACTICAL SOLUTION ASSISTANT PROFESSOR : Gajendra Jingar
FILE WORK Query
Q.1 Display the names of all the employees who are working in department number 10.
-->select emame from emp where deptno=10;
Q.2 Display employees name along with their salary who are MANAGER.
-->select ename,salary from emp where job='manager';
Q3. Display the employees who are getting salary between 12000 and 25000.
-->select * from emp where sal between 12000 and 25000;
Q.4 Display the annual salary of employee od dept 30.
--> select sal*12 as Annual_salary from emp where dept_no=30;
Q.5. Display employee that are clerk and managed by 7698.
-->
Q.6 Display employees of department 10 and 20.
--> select * from emp where dept_no in(10,20);
Q.7 Display employee That are not managers.
--> select * from emp where job not in('manager');
Q.8 Display employee whose name begins with character 'R'.
--> Select * from emp where ename like '%R';
Q.9 display employee that are analyst but getting salary greather than 10000.
-->select ename,salary,job from emp where JOB='ANALYST' AND SAL>10000;
Q.10 Display Employee those are not getting any commission.
-->Select empno ,ename from emp where comm is null and comm=0;
Q.11 Display all employee name along with their jobs?
--> select ename ,job from emp;
Q.12 Display all employee having 'A' in thier names?
--> select * from emp where ename like '%A%';
ACE-Pali/DBMS/PRACTICAL SOLUTION ASSISTANT PROFESSOR : Gajendra Jingar
Q.13.Display all employee having 'T' and 'R' in thier names?
-->
Q.14 .Display all employee that are not there in department 30?
-->select * from emp where dept_no not in(30);
Q.15 Display department located in 'xxxxx'.
--> select * from dept where city='xxxx';
Q.16 Display all the employees who are not 'Salesman' or 'Clerk'.
-->Select ename from emp where job not in(‘clerks’,’salesman’);
Q.17 Display all the employees names in lowercase.
-->Select lower(ename) from emp;
Q.18. Display all employees name with thier length.
-->Select length('rajasthan') from dual;
Q.19 write the query to calculate the length of time any employee has been with the company.
-->
Q.20. List the employee name and salary increased by 15% and expressed as a whole number.
-->SELECT ename, salary, ROUND(salary * 15/100, 0) "New Salary"FROM employees;
Q.21 list of all employee who joined after '01-jan-2000' and before '18-aug-2015'.
-->select ename from emp where hiredate < '01-jan-2000' or hiredate >'18-aug-2015';
Q.22 Display the difference between highest and lowest salary of each department.
-->select * from emp where max(sal)-min(sal);
Q.23. List all jobs for manager and difference between average salary and highest salary.
-->Select avg(sal)-max(sal) as new_salary from emp where job=’MANAGER’;
Q.24.Display minimum and maximum salary for each department.
--> select min(sal) as min_Sal, max(Sal) as max_sal from emp;
Q.25 display employee who earn more than lowest salary of department 30.
--> select ename,salary from emp where sal>min(Sal) and dept_no=30;

More Related Content

Similar to Sql query file work

Introduction to Databases - Assignment_1
Introduction to Databases - Assignment_1Introduction to Databases - Assignment_1
Introduction to Databases - Assignment_1
Mohd Tousif
 
Pooja Jain
Pooja JainPooja Jain
Pooja Jain
dezyneecole
 
SQL practice questions - set 3
SQL practice questions - set 3SQL practice questions - set 3
SQL practice questions - set 3
Mohd Tousif
 
DBMS 5 | MySQL Practice List - HR Schema
DBMS 5 | MySQL Practice List - HR SchemaDBMS 5 | MySQL Practice List - HR Schema
DBMS 5 | MySQL Practice List - HR Schema
Mohammad Imam Hossain
 
Q on subquery
Q on subqueryQ on subquery
Q on subquery
ABHIJEET KHIRE
 
80 different SQL Queries with output
80 different SQL Queries with output80 different SQL Queries with output
80 different SQL Queries with output
Nexus
 
Assignment 2 (16-08-2013)
Assignment 2 (16-08-2013)Assignment 2 (16-08-2013)
Assignment 2 (16-08-2013)
Sanjay Pathak
 
Sql queries with answers
Sql queries with answersSql queries with answers
Sql queries with answers
vijaybusu
 
SQL-RDBMS Queries and Question Bank
SQL-RDBMS Queries and Question BankSQL-RDBMS Queries and Question Bank
SQL-RDBMS Queries and Question Bank
Md Mudassir
 
1 q on operators
1 q on operators1 q on operators
1 q on operators
ABHIJEET KHIRE
 
Sql lab experiments
Sql lab experimentsSql lab experiments
Sql lab experiments
LakshmiSarvani6
 
SQL-AGG-FUN.pdfiiiijuyyttfffgyyuyyyyyhhh
SQL-AGG-FUN.pdfiiiijuyyttfffgyyuyyyyyhhhSQL-AGG-FUN.pdfiiiijuyyttfffgyyuyyyyyhhh
SQL-AGG-FUN.pdfiiiijuyyttfffgyyuyyyyyhhh
NaveeN547338
 

Similar to Sql query file work (15)

Introduction to Databases - Assignment_1
Introduction to Databases - Assignment_1Introduction to Databases - Assignment_1
Introduction to Databases - Assignment_1
 
Pooja Jain
Pooja JainPooja Jain
Pooja Jain
 
SQL practice questions - set 3
SQL practice questions - set 3SQL practice questions - set 3
SQL practice questions - set 3
 
DBMS 5 | MySQL Practice List - HR Schema
DBMS 5 | MySQL Practice List - HR SchemaDBMS 5 | MySQL Practice List - HR Schema
DBMS 5 | MySQL Practice List - HR Schema
 
SQL BASIC QUERIES
SQL  BASIC QUERIES SQL  BASIC QUERIES
SQL BASIC QUERIES
 
Sql wksht-9
Sql wksht-9Sql wksht-9
Sql wksht-9
 
SQL BASIC QUERIES SOLUTION ~hmftj
SQL BASIC QUERIES SOLUTION ~hmftjSQL BASIC QUERIES SOLUTION ~hmftj
SQL BASIC QUERIES SOLUTION ~hmftj
 
Q on subquery
Q on subqueryQ on subquery
Q on subquery
 
80 different SQL Queries with output
80 different SQL Queries with output80 different SQL Queries with output
80 different SQL Queries with output
 
Assignment 2 (16-08-2013)
Assignment 2 (16-08-2013)Assignment 2 (16-08-2013)
Assignment 2 (16-08-2013)
 
Sql queries with answers
Sql queries with answersSql queries with answers
Sql queries with answers
 
SQL-RDBMS Queries and Question Bank
SQL-RDBMS Queries and Question BankSQL-RDBMS Queries and Question Bank
SQL-RDBMS Queries and Question Bank
 
1 q on operators
1 q on operators1 q on operators
1 q on operators
 
Sql lab experiments
Sql lab experimentsSql lab experiments
Sql lab experiments
 
SQL-AGG-FUN.pdfiiiijuyyttfffgyyuyyyyyhhh
SQL-AGG-FUN.pdfiiiijuyyttfffgyyuyyyyyhhhSQL-AGG-FUN.pdfiiiijuyyttfffgyyuyyyyyhhh
SQL-AGG-FUN.pdfiiiijuyyttfffgyyuyyyyyhhh
 

More from Anjaan Gajendra

Bca examination 2017 dbms
Bca examination 2017 dbmsBca examination 2017 dbms
Bca examination 2017 dbms
Anjaan Gajendra
 
Bca examination 2016 dbms
Bca examination 2016 dbmsBca examination 2016 dbms
Bca examination 2016 dbms
Anjaan Gajendra
 
Bca examination 2015 dbms
Bca examination 2015 dbmsBca examination 2015 dbms
Bca examination 2015 dbms
Anjaan Gajendra
 
Bca examination 2016 csa
Bca examination 2016 csaBca examination 2016 csa
Bca examination 2016 csa
Anjaan Gajendra
 
Bca examination 2015 csa
Bca examination 2015 csaBca examination 2015 csa
Bca examination 2015 csa
Anjaan Gajendra
 
Multi media unit-4.doc
Multi media unit-4.docMulti media unit-4.doc
Multi media unit-4.doc
Anjaan Gajendra
 
Multi media unit-3.doc
Multi media unit-3.docMulti media unit-3.doc
Multi media unit-3.doc
Anjaan Gajendra
 
Multi media unit-2.doc
Multi media unit-2.docMulti media unit-2.doc
Multi media unit-2.doc
Anjaan Gajendra
 
Multimedia notes
Multimedia  notesMultimedia  notes
Multimedia notes
Anjaan Gajendra
 
Computer system architecture (microprocessor 8085) unit 4
Computer system architecture (microprocessor 8085) unit  4Computer system architecture (microprocessor 8085) unit  4
Computer system architecture (microprocessor 8085) unit 4
Anjaan Gajendra
 

More from Anjaan Gajendra (10)

Bca examination 2017 dbms
Bca examination 2017 dbmsBca examination 2017 dbms
Bca examination 2017 dbms
 
Bca examination 2016 dbms
Bca examination 2016 dbmsBca examination 2016 dbms
Bca examination 2016 dbms
 
Bca examination 2015 dbms
Bca examination 2015 dbmsBca examination 2015 dbms
Bca examination 2015 dbms
 
Bca examination 2016 csa
Bca examination 2016 csaBca examination 2016 csa
Bca examination 2016 csa
 
Bca examination 2015 csa
Bca examination 2015 csaBca examination 2015 csa
Bca examination 2015 csa
 
Multi media unit-4.doc
Multi media unit-4.docMulti media unit-4.doc
Multi media unit-4.doc
 
Multi media unit-3.doc
Multi media unit-3.docMulti media unit-3.doc
Multi media unit-3.doc
 
Multi media unit-2.doc
Multi media unit-2.docMulti media unit-2.doc
Multi media unit-2.doc
 
Multimedia notes
Multimedia  notesMultimedia  notes
Multimedia notes
 
Computer system architecture (microprocessor 8085) unit 4
Computer system architecture (microprocessor 8085) unit  4Computer system architecture (microprocessor 8085) unit  4
Computer system architecture (microprocessor 8085) unit 4
 

Recently uploaded

CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
Celine George
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
GeoBlogs
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
Excellence Foundation for South Sudan
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
Steve Thomason
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
Vivekanand Anglo Vedic Academy
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
Nguyen Thanh Tu Collection
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
EduSkills OECD
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
Celine George
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 

Recently uploaded (20)

CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 

Sql query file work

  • 1. ACE-Pali/DBMS/PRACTICAL SOLUTION ASSISTANT PROFESSOR : Gajendra Jingar FILE WORK Query Q.1 Display the names of all the employees who are working in department number 10. -->select emame from emp where deptno=10; Q.2 Display employees name along with their salary who are MANAGER. -->select ename,salary from emp where job='manager'; Q3. Display the employees who are getting salary between 12000 and 25000. -->select * from emp where sal between 12000 and 25000; Q.4 Display the annual salary of employee od dept 30. --> select sal*12 as Annual_salary from emp where dept_no=30; Q.5. Display employee that are clerk and managed by 7698. --> Q.6 Display employees of department 10 and 20. --> select * from emp where dept_no in(10,20); Q.7 Display employee That are not managers. --> select * from emp where job not in('manager'); Q.8 Display employee whose name begins with character 'R'. --> Select * from emp where ename like '%R'; Q.9 display employee that are analyst but getting salary greather than 10000. -->select ename,salary,job from emp where JOB='ANALYST' AND SAL>10000; Q.10 Display Employee those are not getting any commission. -->Select empno ,ename from emp where comm is null and comm=0; Q.11 Display all employee name along with their jobs? --> select ename ,job from emp; Q.12 Display all employee having 'A' in thier names? --> select * from emp where ename like '%A%';
  • 2. ACE-Pali/DBMS/PRACTICAL SOLUTION ASSISTANT PROFESSOR : Gajendra Jingar Q.13.Display all employee having 'T' and 'R' in thier names? --> Q.14 .Display all employee that are not there in department 30? -->select * from emp where dept_no not in(30); Q.15 Display department located in 'xxxxx'. --> select * from dept where city='xxxx'; Q.16 Display all the employees who are not 'Salesman' or 'Clerk'. -->Select ename from emp where job not in(‘clerks’,’salesman’); Q.17 Display all the employees names in lowercase. -->Select lower(ename) from emp; Q.18. Display all employees name with thier length. -->Select length('rajasthan') from dual; Q.19 write the query to calculate the length of time any employee has been with the company. --> Q.20. List the employee name and salary increased by 15% and expressed as a whole number. -->SELECT ename, salary, ROUND(salary * 15/100, 0) "New Salary"FROM employees; Q.21 list of all employee who joined after '01-jan-2000' and before '18-aug-2015'. -->select ename from emp where hiredate < '01-jan-2000' or hiredate >'18-aug-2015'; Q.22 Display the difference between highest and lowest salary of each department. -->select * from emp where max(sal)-min(sal); Q.23. List all jobs for manager and difference between average salary and highest salary. -->Select avg(sal)-max(sal) as new_salary from emp where job=’MANAGER’; Q.24.Display minimum and maximum salary for each department. --> select min(sal) as min_Sal, max(Sal) as max_sal from emp; Q.25 display employee who earn more than lowest salary of department 30. --> select ename,salary from emp where sal>min(Sal) and dept_no=30;