SQL Queries
SQL Queries
------------
PROGRAMMER :
-----------------------------------------------------------------------
PNAME DOB DOJ SEX PROF1 PROF2 SALARY
-----------------------------------------------------------------------
ANAND 21-APR-62 21-APR-92 M PASCAL BASIC 3200
ALTAF 02-JUL-64 13-NOV-90 M CLIPPER COBOL 2800
JULAIMA 31-JAN-68 21-APR-90 M COBOL DBASE 3000
KAMALA 30-OCT-68 2-JAN-92 F DBASE DBASE 2900
MARY 24-JUL-70 1-FEB-91 F ORACLE ORACLE 4500
NELSON 11-SEP-85 11-OCT-89 M DBASE DBASE 2500
PATRIC 10-NOV-65 21-APR-90 M CLIPPER CLIPPER 2800
QUADIR 31-AUG-65 21-APR-91 M c c 3000
RAMESH 3-MAY-67 28-FEB-91 M DBASE DBASE 3200
RESECCA 1-JAN-61 29-DEC-90 M COBOL COBOL 2500
REMITHA 19-APR-70 20-APR-93 F ASSEMBLY ASSEMBLY 3600
REVATHI 2-DEC-69 2-JAN-92 F BASIC BASIC 3700
VIJAYA 14-DEC-65 2-MAY-92 F C C 3500
-----------------------------------------------------------------------
STUDIES :
-----------------------------------------------------------------------
PNAME SPLACE COURSE COST
-----------------------------------------------------------------------
ANAND SABHARI PGDCA 4500
ALTAF COIT DCA 7200
JULAIMA BITS MCA 22000
KAMALA PRAGATHI DCP 5000
MARY SABHARI PGDCA 4500
NELSON PRAGATHY DAP 6200
PATRIC PRAGATHY DCAP 5200
QUADIR APPLE HDCP 14000
RAMESH SABHARI PGDCA 4500
REBECCA BNRILLIANI DCA&P 11000
REMITHA BDPS DCS 6000
REVATHY SABHARI DAP 5000
VIJAYA BDPS DCA 48000
-----------------------------------------------------------------------
SOFTWARE :
PNAME TILTE DEV-IN SCOST DCOST SOLD
-------------------------------------------------------------------------------
ANAND PARACHITES BASIC 399.95 6000 43
ANAND VIDEOTITLING PACK PASCAL 7500.00 160000 9
JULAINA INVENTORY CONTROL COBBOL 3000 5500 0
KAMALA PAYROLLPACKAGE DBASE 9000 20000 7
MARY FINACIAL ACC S\W ORACLE 18000 85000 4
MARY CODE GENRATOR C 4500 20000 23
PATRIC READ ME C++ 300 1200 84
QUADIR BOMBSAWAY ASSEMBLY 750 5000 11
QUADIR VACCIENES C 1900 3400 21
RAMESH HOTELMENAGEMENT DBASE 12000 3500
4
RAMESH DEAL LEE PASCAL 599 4500 73
REMITHA PC UTILITIES C 725 500 51
REMITHA TST HELP ASSEMBLY 2500 6000 6
RAVATHY HOSPITAL MANAGEMENT PASCAL 1100 75000 2
REVATHY QUIZMASTER BASIC 3200 2100 15
VIJAYA ISK EDITOR C 900 700 6
-----------------------------------------------------------------------------
QUERY-I :
---------
QUERY - III :
-----------------
1.Display the details of those who are drawing the same salary.
2.Display the details of the software developed by the male programmers earing m
ore than 3000.
3.Display the details of the packages developed in pascal by female programmers
.
4.Display the details of those programmers who joined before 1990.
5.Display the details of the software developed in
c by female programmers of PRAGATHI.
6.Display the number of packages number of copies sold and sales value of each p
rogrammer ,institute-wise.
7.Display the details of software developed in dbase by male programmers who be
long to the institute which most number of programmers studied .
8.Display the details of the software developed by the male programmers who bel
ong to the female programmers born after 1975.
9.Display the details of the software that was developed in the language that
is not the programmer's first proficiency.
10.Display the details of the software that was developed in the language that i
s neither the first nor the second proficiency of the programmer.
11.Display the details of the software developed by the male students of sabhar
i.
12.Display the names of the programmers who have not developed any package.
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 students who have the same prof2.
16.Display the total cost of the software institute -wise.
17.Display the total scost ,dcost and amount to be recovered for each programme
r for those whose dcost has not yet been recovered .
18.who are the male programmers earing below the average salary of female progra
mmers .
19.which language has been stated as prof1 by most of the programmers .
20.Display the name ,job,dob,doj, of those month of birthh and month of joining
are the same ?
21.Display the names of the packages whose names contain more than one word?:
QUERY IV
1. In which institute did the person who developed the costliest package study?
2. Which language listed in Prof1 and prof2 has not been used to developed any
package.
3. How much does the person who developed the highest selling package earn? Wha
t course did he/she underdgo?
4. How many months will it take for each programmer to recover the cost of the
course underwent?
5. Which is the costlies package developed by a person with three years experie
nce?
6. What is the average salary for those whose software's sales value is more th
an 50000?
7. How many packages were developed by student who studied in institute that ch
arge the lowest course fee?
8. How many packages were developed by the person who develop the cheapest pack
age, where did he study?
9. How many packages were developed by female programmer earning more than high
est paid male programmer?
10. How many packages were developed by the mast experienced programmer from bdp
S?
11. List the programmers(from software table) and the institutes they studies in
cluding those who didn't developed any package?
12. List each prof1 with the number of programmer having the prof1 and number of
packages developed in prof1?
13. List the programmer names(from progrmmer table) and the number of packages e
ach has developed?
14. Display the details of those who will be completing two years of service thi
s year?
15. Calculate the amount to be recovered for those packages whose development co
st has not yet recovered?
16. List the packages that have not been sold so far?
17. find the cost of the software developed by mary?
18. Display the isntitute names from the studies table without duplicates?
19. How many different courses are mentioned in the studies table?
20. Display the names of programmers whose names contain two occurrences of the
letter 'a'?
21. Display the names of programmers whose names contain up to 5 characters?
22. How many female programmer knowing cobol have more than two years experience
?
23. What is the length of the shortest name in ht programmer table?
24. What is the average development cost of the package developed in cobol?
25. Display the name,sex, dob(dd/mon/yy format) for all the programmer without u
sing conversion function?
26. Who are the programmers born on the last day of the month?
27. Who are the programmers born on the last day of the month?
28. What is the amount paid in salaries of the male programmers who don'tknow co
bol?
29. Display the title, scost and difference between scost and dcost in descendin
g order of diffrence?