Posts

Showing posts from March, 2023

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...

SQL_chapter1_assignment

 --1.Find out the selling cost AVG for packages developed in Pascal. Select AVG(SCOST) as [Average selling cost] From SOFTWARE Where DEVELOPIN='PASCAL'; --2.Display Names, Ages of all Programmers. select pname as Names, DATEDIFF(YY,[DOB],GETDATE()) as [Age] from programmer; --3.Display the Names of those who have done the DAP Course. Select PNAME as Names, COURSE from STUDIES where COURSE = 'DAP'; --4.Display the Names and Date of Births of all Programmers Born in January. Select PNAME as Names,DOB, DATENAME(MM, DOB) as [Month] from PROGRAMMER where DATENAME(MM, DOB) = 'January' --5.Display the Details of the Software Developed by Ramesh select * from SOFTWARE where PNAME='Ramesh' --6. Display the Details of Packages for which Development Cost have been recovered. select * , (SCOST*SOLD) as [Total Sale] from SOFTWARE  where (SCOST*SOLD) > DCOST --7. Display the details of the Programmers Knowing C select pname from PROGRAMMER where PROF1='C' o...