5. Find out the number of copies which should be sold in order to recover thedevelopment cost of each package.
select round (( dcost / scost ),0) as[no of copies]fromsoftware
6. Display the details of packages for which the development cost has beenrecovered.Ans: select pname,title,devin,scost,dcost,sold from softwarewhere (scost*sold)>=dcost 7. How many programmers paid 10000 to 15000 for the course?Ans: select count(PNAME) FROM STUDIES where CCOST BETWEEN 10000
150008. How old is the oldest male programmer?ans:
select max((year (getdate())-year (dob)))[oldest male programmer]fromprogrammer wheresex='m'
9. How many programmers don’t know C and C++?ans:
select count ( pname) fromprogrammer where ( prof1<>'c' and prof2<>'c' ) and ( prof1<>'c++' and prof2<>'c' )
10.Calculate the experience in years for each programmer and display along withtheir names in descending order.
select pname,year ( getdate())-year ( doj) fromprogrammer order bypnamedesc
11.Who are the programmers who celebrate their birthdays during the current month?
select pname,dobfromprogrammer where month( dob)=month( getdate())
12.What are the languages known by the male programmers?Ans: select PNAME,PROF1 language1,PROF2 language2 from PROGRMMMERwhere sex='M' 13.Display the costliest package developed by each programmer.
select pname,max( scost ) fromsoftwaregroup bypname
14.Produce the following output for all the male programmersProgrammer Mr. Arvind – has 15 years of experience
select 'mr ' +pname+' has ' + cast ( year ( getdate())-year ( doj) as varchar ) + ' years of experience ' from
programmer WHERE sex='m'
15.What is the highest number of copies sold by a package?
select title,max( sold ) fromsoftwaregroup bytitle