SQL Quaries Q & A 100
SQL Quaries Q & A 100
14) Display the TOTAL development COST of the packages developed in EACH
language.
15) Display the selling cost of the package developed in EACH language.
17) Display the sales values of the package developed in EACH programmer.
21) Display EACH language name with AVERAGE development cost, AVERAGE cost,
selling
cost and AVERAGE price per copy.
22) Display EACH institute name with NUMBER of courses, AVERAGE cost per
course.
27) Display the NUMBER of packages in EACH language for which development
cost is less than
1000.
SELECT COUNT(TITLE),DEV_IN FROM SOFTWARE WHERE DCOST<1000 GROUP BY
DEV_IN;
28) Display the AVERAGE difference BETWEEN scost and dcost for EACH
language.
29) Display the TOTAL scost, dcsot and amount TOBE recovered for EACH
programmer for
whose dcost HAS NOT YET BEEN recovered.
30) Display highest, lowest and average salaries for THOSE earning MORE
than 2000.
54,56,48,49,24,4,51,61,65,74,76,77,78
1) Display the details of THOSE WHO are drawing the same salary.
select name, salary from programmer where salary = any(select salary from
programmer p group by salary having salary=p.salary and count(*)>1);
select s.* from programmer p,software s where p.name=s.name and sex='f' and
dev_in='pascal';
4) Display the details of these programmer WHO joined BEFORE 1990.
9) Display the details of the software that was developed in the language
that is NOT the programmers first proficiency.
select distinct x.* from software x, programmer y where y.prof1 <>
x.dev_in and x.name = y.name;
10) Display details of software that was developed in the language which is
NITHER first NOR second proficiency of the programmer.
select s.* from programmer p,software s where s.name=p.name and (dev_in <>
prof1 and dev_in <> prof2);
12) Display the names of programmers WHO HAVE NOT developed any package.
select name from programmer where name not in(select name from
software);
13) What is the total cost of the software developed by the programmers by
APPLE?
14) Who are the programmers WHO JOINED in the same day?
15) Who are the programmers WHO HAVE THE SAME PROF2?
select name from programmer where prof2 = any(select prof2 from programmer
group by prof2 having count(*) >1);
17) In which institutes did the person who developed the COSTLIEST package
study?
18) Which language listed in prof1 and prof2 HAS NOT BEEN used to develop
any package?
select prof1 from programmer where prof1 not in(select dev_in from
software) union select prof2 from programmer where prof2 not in(select
dev_in from software);
19) How much does the person WHO developed the HIGHEST selling package earn
and WHAT
course did he/she undergo?
20) How many months will it take for each programmer to recover the cost of
the course underwent?
21) Which is the COSTLIEST package developed by a person with under 3 years
expenence?
23) How many packages were developed by the students WHO studied in the
institute that Charge the LOWEST course fee?
24) How many packages were developed by the person WHO developed the
CHEAPEST
package. Where did he\she study?
25) How many packages were developed by female programmers earning MORE
than the
HIGHEST paid male programmer?
26) How many packages were developed by the MOST experienced programmers
from BDPS.
27) List the programmers (from software table) and institutes they studied,
including those WHO DIDN'T develop any package.
select name,splace from studies where name not in(select name from
software);
28) List each profit with the number of programmers having that prof1 and
the number of packages developed in that prof1.
29) List programmer names (from programmer table) and number of packages
EACH developed.
30) List all the details of programmers who has done a course at S.S.I.L.
select programmer.* from programmer,studies where splace='SSIL' and
programmer.name=software.name and programmer.name=studies.name and
studies.splace='s.s.i.l.';