SQL_Chapter2_Assignment
--1. what is the highest number of copies sold by a package SELECT MAX(SOLD) FROM SOFTWARE; --2. Display lowest course fee select min([course fee]) from STUDIES; --3. how old is the oldest male programmer select Max(DATEDIFF(YY,DOB, GETDATE())) as age from PROGRAMMER where GENDER= 'M'; --4.what is AVG age of femle programmers Select AVG(DATEDIFF(YY,DOB, GETDATE())) as [avg age] from PROGRAMMER where GENDER='F'; --5. Calculate the experience in years for each programmers and display along with the names in descending order? select pname, DATEDIFF(YY, DOJ, GETDATE()) as[experience in years] from PROGRAMMER order by DATEDIFF(YY, DOJ, GETDATE()) desc; --6. How many programmers done the PGDCA Course? select COUNT(Pname) as [programmers done the PGDCA] from STUDIES where course = 'PGDCA' --7. How much revenue has been earned through sales of Packages Developed in C select sum(scost*sold) as Revenue from SOFTWARE where DEVELOPIN='C' --8. How many Programmers S...