0% found this document useful (0 votes)
938 views5 pages

Queries: Iii: 1-Who Is The HIGHEST Paid Programmer For EACH Language (Prof1)

The document contains the results of 16 SQL queries: 1) Finds the highest paid programmers for each language. 2) Finds the highest paid female COBOL programmer. 3) Finds the least experienced programmer. 4) Finds the most experienced programmer knowing Pascal. 5) Finds the youngest programmer knowing DBASE. 6) Finds female programmers earning over 3000 not knowing C, C++, Oracle, or DBASE. 7-15) Find various other details about programmers, packages, and courses. 16) Displays packages sold less than the average.

Uploaded by

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

Queries: Iii: 1-Who Is The HIGHEST Paid Programmer For EACH Language (Prof1)

The document contains the results of 16 SQL queries: 1) Finds the highest paid programmers for each language. 2) Finds the highest paid female COBOL programmer. 3) Finds the least experienced programmer. 4) Finds the most experienced programmer knowing Pascal. 5) Finds the youngest programmer knowing DBASE. 6) Finds female programmers earning over 3000 not knowing C, C++, Oracle, or DBASE. 7-15) Find various other details about programmers, packages, and courses. 16) Displays packages sold less than the average.

Uploaded by

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

QUERIES: III

1-Who is the HIGHEST paid programmer for EACH language (prof1).


SQL> select prof1,name from anupam programmer where (prof1,salary) in (select
prof1,max(salary) from amit_programmer group by prof1);
PROF1

NAME

---------- ---------CLIPPER

ALTAF

COBOL

JULIANA

ASSEMBLY QADIR
C

REMITHA

ORACLE
C++

JAGADISH
MARY

FOXPRO

VIJAYA

PASCAL

REVATHI

BASIC

REBEECA

9 rows selected.
-----------------------------------------------------------------------------------------------------------------------------------------

2-Who is the HIGHEST paid female COBOL programmer.


SQL> select name from anupam_programmer where (name,salary) in (select
name,max(salary) from amit_programmer where sex='F' and prof1='COBOL' group
by name);
NAME
---------JULIANA

----------------------------------------------------------------------------------------------------------------------------------------3-Who is the LEAST experienced programmer.


SQL> select name,round((sysdate-doj)/365)"EXPERIENCE" from
anupam_programmer where (round((sysdate-doj)/365)) in (select
min(round((sysdate-doj)/365)) from programmer);
NAME

EXPERIENCE

---------- ---------REMITHA

19

-----------------------------------------------------------------------------------------------------------------------------------------

4-Who is the MOST experienced programmer knowing PASCAL.


SQL> select name,round((sysdate-doj)/365)"EXPERIENCE" from
anupam_programmer where (round((sysdate-doj)/365)) in (select
max(round((sysdate-doj)/365)) from programmer where prof1='PASCAL' or
prof2='PASCAL');
NAME

EXPERIENCE

---------- ---------PATRICK

24

-----------------------------------------------------------------------------------------------------------------------------------------

5-Who is the YOUNGEST programmer knowing DBASE.


SQL> select name,round((sysdate-dob)/365)"AGE" from anupam_programmer
where (round((sysdate-dob)/365)) in (select min(round((sysdate-dob)/365)) from
programmer where prof1='DBASE' OR prof2='DBASE');
NAME

AGE

---------- ---------KAMLA

44

-----------------------------------------------------------------------------------------------------------------------------------------

6-Which female programmer earns more than 3000 but DOES NOT know C,
C++, ORACLE or DBASE.
SQL> select name from programmer where (sex='F' and salary>3000 and (prof1)
not in ('C','C++','ORACLE','DBASE') AND (prof2) not in ('C','C++','ORACLE','DBASE'));
NAME
---------REVATHI
-----------------------------------------------------------------------------------------------------------------------------------------

10-Which institute conducts the COSTLIEST course.


SQL> select splace from studies where ccost in (select max(ccost) from studies);
SPLACE
---------BDPS
-----------------------------------------------------------------------------------------------------------------------------------------

11-Which package have HIGHEST development cost.


SQL> select title from software where dcost in (select max(dcost) from software);
TITLE
------------------------FINANCIAL ACC. SOFTWARE
-----------------------------------------------------------------------------------------------------------------------------------------

12-Who developed the package, which has sold the LEAST number of
copies.
SQL> select name from software where sold in (select min(sold) from software);

NAME
---------JULIANA
-----------------------------------------------------------------------------------------------------------------------------------------

13-Which is the COSTLIEST package developed in PASCAl.


SQL> select title from software where scost in(select max(scost) from software
where dev_in='PASCAL');
TITLE
------------------------VIDEO TILTING PACK
-----------------------------------------------------------------------------------------------------------------------------------------

15-Who is the author of COSTLIEST package.


SQL> select name from software where scost in (select max(scost) from software);
NAME
---------MARY
-----------------------------------------------------------------------------------------------------------------------------------------

16-Display the name of packages WHICH have been sold LESS THAN the
AVERAGE number of copies.
SQL> select title from software where sold<(select avg(sold) from software);
TITLE
------------------------VIDEO TILTING PACK

SERIAL LINK UTILITY


SHARES MANAGEMENT
INVENTRY CONTROL
PAYROLL PACKAGE
FINANCIAL ACC. SOFTWARE
CODE GENERATOR
GRAPHIC EDITOR
VACCINES
HOTEL MANAGEMENT
TSR HELP PACKAGE

TITLE
------------------------HOTEL MANAGEMENT
QUIZ MASTER
ISK EDITOR
INVENTRY CONTROL

15 rows selected.
-----------------------------------------------------------------------------------------------------------------------------------------

You might also like