Revision SQL
Revision SQL
Ravi has given the following command to obtain the Maximum salary
Select max(salary) from emp where group by job;
But he is not getting he desired result. Help him by writing the correct command.
a. Select max(salary) from emp where group by job;
b. Select Job, max(salary) from emp group by job;
c. Select job, max(salary) group by job from emp;
d. Select job, max(salary) from emp group by salary;
—----------------------------------------------------------------------------------------------------------
Manager of the company has given the following command to
obtain the lowest salary in different city. Select min(salary)
from Trainer where group by City; but he is not getting the
desired result. Help him by writing the correct command.
a) Display employee name and bonus after rounding off to zero decimal
places.
b) Display the position of occurrence of the string “ee” in employee names.
c) Display the four characters from employee name starting from
second character.
d) Display the day name for the date of joining of employee
e) Display the name of the month from the date of joining of employee
—-----------------------------------------------------------------------------------------
Write the SQL functions which will perform the following operations:
i) To display the name of the day of the current date.
ii) To remove spaces from the beginning of a string, “ Python”.
iii) To display the name of the month eg, January or February from your date
of birth.
iv) To display the starting position of word “Information” from
“Information Technology”
v) To compute the power of two numbers a and b