Professional Documents
Culture Documents
Find out the selling cost average for packages developed in PASCAL
AVG(SCOST)
----------
600
NAME AGE
-------------------- ---------
bala 28
riya 20
kanan 22
mano 26
kathir 24
sam 23
anand 26
3.Display the Names of those who have done the DAP Course
NAME
---------------
mano
MAX(SOLD)
---------
2000
5.Display the NAMES AND DATE OF BIRTH of all programmers born in JANUARY.
NAME DOB
-------------------- ---------
sam 16-JAN-96
MIN(CCOST)
----------
2000
NAME
---------------
anand
kanan
sam
revathi
8.How much revenue has been earned thru� sale of packages developed in C
SUM(SCOST*SOLD)
---------------
68740
NAME TITLE
-------------------- --------------------
ramesh hotel mgmt
ramesh payroll pack
COUNT(NAME)
-----------
2
11.Display the Details of PACKAGES whose sales CROSSED the 2000 mark.
NAME
--------------------
ram
sam
karthi
anand
kathir
babu
riya
mary
revathi
ramesh
ramesh
12.Find out he NUMBER OF COPIES which should be sold in order to recover the
DEVELOPMENT
13.Display the details of packages for WHICH developments cost has been recovered
MAX(SCOST)
----------
12000
MAX(DCOST)
----------
2200
COUNT(NAME)
-----------
3
COUNT(NAME)
-----------
1
17. HOW MANY programmers paid 5000 to 10000 for their course
COUNT(NAME)
-----------
4
AVG(CCOST)
----------
5666.6667
SQL> select count(name) from pgm where prof1 not in('cobol','pascal') or prof2
in('cobol','pascal');
COUNT(NAME)
-----------
4
21.HOW MANY programmers DON�T know PASCAL & C
SQL> select count(name) from pgm where prof1 not in('pascal','c') and prof2 not
in('pascal','c');
COUNT(NAME)
-----------
5
MAX(FLOOR((SYSDATE-DOB)/365))
-----------------------------
28
AVG(FLOOR((SYSDATE-DOB)/365))
-----------------------------
23
24.CALCULATE the experience in Years for each programmers and display along with
the names, in DESCENDING order
SQL> select name , floor ((sysdate-doj)/365) as experience from pgm order by name
desc;
NAME EXPERIENCE
-------------------- ----------
sam 0
riya 1
mano 3
kathir 1
kanan 2
bala 9
anand 1