Sie sind auf Seite 1von 4

Display the names of those who have done the DAP course.

select pname from studies where course='DAP


1
What is the highest number of copies sold by a package?
2

select title,sold from software where sold=(select max(sold) from software);


Display the names and date of birth of all programmers born in January?

select pname,dob from programmer where


trim(to_char(dob,'month'))='january'
Display the lowest course fee

select course,ccost from studies where ccost=(select min(ccost) from


studies) group by course,ccost;
How many programmers have done the PGDCA course?

select course, pname from studies where course='PGDCA';


select pname from studies where course='PGDCA';
How much revenue has been earned thru the sales of package developed in C?

select sum(sold-dcost) revenue, dev_in from software where dev_in='C'


group by dev_in
Display the details of packages whose sales crossed the 2000 mark?

7
How many programmers paid 5000 to 10000 for their course?
8

select pname, course from studies where ccost between 5000 and 10000;
What is the average course fee?

select avg(ccost) from studies;


How many programmers know either COBOL or PASCAL?

10

select count(pname) from programmer where prof1 in ('COBOL','PASCAL')


or prof2 in ('COBOL','PASCAL');
How old is the oldest male programmer?

11

select round(to_char((sysdate-(select min(dob) from programmer where


sex='M' ))/365)) age from dual;
Display the sales values of packages developed by each programmer

12
13

select pname, scost, title from software group by pname, scost, title;
Display number of packages sold by each programmer

select pname,(sold/scost) sold from software group by pname, sold/scost

Display each language name with average development cost, average selling cost and average price per
copy

14

select dev_in, avg(dcost),avg(scost),avg(sold/scost) from software group


by dev_in;
Display each programmers name, costliest and cheapest package developed.

15

select pname, max(scost),min(scost) from software group by pname;


Display each institute name with number of students.

16

select count(pname),splace from studies group by splace;


Display the average difference between scost and dcost for each language

17

select dev_in as Language, abs(avg(scost-dcost)) as Difference from


software group by dev_in;
Display the total scost, dcost and the amount to be recovered for each programmer for those, whose
dcost has not yet been recovered

18
Display the highest, lowest and average salaries for those earning more than 2000

19

select max(salary) max, min(salary) min, avg(salary) avg from programmer


where salary>2000;
Who is the highest paid C programmer?

20

select pname, salary from (select * from programmer where salary=(select


max(salary) from programmer where (prof1='C' or prof2='C')))
Who is the highest paid female COBOL programmer?

21

select pname from programmer where sex='F' and prof1='HTML' or


prof2='HTML';
Display the name of the highest paid programmer for each language (prof1)

22

select pname,prof1,max(salary) from programmer group by pname,prof1;


Who is the least experience programmer?

23

select pname, doj from programmer where doj=(select max(doj) from


programmer);
Display the details of the software that was developed by male programmers born before 1965 and
female programmers born after 1975

24
25

select * from software where pname in (select pname from programmer


where sex='M' and to_char(dob, 'YYYY')<1983) or pname in (select pname
from programmer where sex='F' and to_char(dob, 'YYYY')>1975);
Display the name of programmers who have not developed any package.

select pname from programmer where pname not in (select pname from

software) group by pname

Das könnte Ihnen auch gefallen