Function in Mysql (Home Work) 11 Apr 2020: Multiple Choice Questions

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Function in MySQL (Home work) 11 Apr 2020

Multiple Choice Questions


1) ________________functions operate on a single value to return a single
value.
2) SUM, AVG,COUNT are examples of ____________________functions.
3) SELECT POW(-3,2) will display the output:
4) INSTR(str,str2) returns the position of the first occurrence of ______in
________.
5) Any String function returns ____________ or ________________ type data.

Answer the following questions.


1) Define a Function.
2) List 3 categories of single row functions. Give two examples in each
category.
3) Name a
i) date function that returns a number.
ii) String function that returns a number.
iii) date function that returns a date.
4) Write SQL statements to do the following:
i) Use the string "Internet is a boon" and extract the string "net".
ii) Display the length of the string "Informatics Practices".
iii) Display the position of "My" in "Enjoying MySQL".
iv) Display the name of current month.
5) Write the output that the following statements will produce:
i) SELECT ROUND(7.3456, 2);
ii) SELECT ROUND(356.3456, -2);
iii) SELECT MONTHNAME('2009-08-25');
iv) SELECT MONTH('2010-02-26');
v) SELECT RIGHT('Informatics', 4);

You might also like