Professional Documents
Culture Documents
IP_practical_XII
IP_practical_XII
ACKNOWLEDGEMENT
Ans. Select name from students where city = “Agra” or city = “Mumbai”;
(iii) Prachi has given the following command to obtain highest marks
select max(marks) from students where group by class;
But she is not getting the desired result. Help her by writing the correct
command.
By gender;
(v) Help Ritesh to write the command to display the name of the youngest
student ?
(i) Display the average price of each type of vehicle having quantity more
than 20.
Ans. select avg(Price) from vehicle group by Qty having Qty > 20;
(ii) Display the position of occurrence of the string “ta” in salesman names.
(iii) Display four characters from salesman name starting from second
character.
(v) Display the name of the weekday for the date of join of the salesman.
(iv) To display category and category wise highest price of the products.
Q7. Write output for SQL queries which are based on the given table PURCHASE:
(i) select length(CName) from purchase Where Quantity > 100;
(i) Display 7 characters extracted from 7 left character onwards from the
string “INIDA SHINING”.
shop. Help her by writing answers of the following questions based on the
given table:
(iii) Write a query to count total number of cloths purchased of medium size.
Ans. select sum(Price) from cloth group by Size having Size = “M”;
(i) Returns the position of the first occurrence of the substring “The” in the
given string.
Ans. select instr(“12#All The Best!”, “The”);