1) Consider a table Salesman with the following data:
Table : Salesman SNO SNAME SALARY BONUS DATE_OF_JOIN A01 Beena Mehta 30000 45.23 29-10-2019 A02 K. L. Sahay 50000 25.34 13-03-2018 B03 Nisha Thakkar 30000 35.00 18-03-2017 B04 Leela Yadav 80000 NULL 31-12-2018 C05 Gautam Gola 20000 NULL 23-01-1989 C06 Trapti Garg 80000 12.37 15-06-1987 D07 Neena Sharma 50000 27.89 18-03-1989 Write SQL queries using SQL functions to perform the following operations: (i) Display salesman name and square of bonus after rounding off to zero decimal places. (ii) Display the position of occurrence of the string “ta” in salesman names. (iii) Display the four characters from salesman name starting from second character. (iv) Display the month name for the date of join of salesman. (v) Display the name of the weekday for the date of join of salesman. (vi) Display first four characters and last three characters from SNAME column. (vii) Display the length of SNAME for which there is nothing in BONUS column. (viii) Display all those names in capital letters that ends with ‘a’. (ix) Display sno joined with first four letters of sname. (x) Display the details of all those whose year of joining is 2018. (xi) Display the complete details in descending order of salary. (xii) Display the count of unique salary in the table. (xiii) Display the maximum and minimum salary. (xiv) Display the average salary where bonus is more than 35. (xv) Display the total number of rows having some value in bonus column.
Q.2) Consider the following table Vehicles :
Table : Vehicles V_No Type Company Price Qty AW125 Wagon Maruti 250000 25 J0083 Jeep Mahindra 4000000 15 S9090 SUV Mitsubishi 2500000 18 M0892 Mini Van Datsun 1500000 26 W9760 SUV Maruti 2500000 18 R2409 Mini Van Mahindra 350000 15 Basis on above table , write SQL commands for the following questions. (i) Display the average price of each type of vehicle having quantity more than 20. (ii) Count the type of vehicles manufactured by each company. (iii) Display the total price of all the types of vehicles. (iv) Display the maximum and minimum price for each company.