Important QnA MySQL Functions class 12 IP

Welcome to QnA session MySQL Functions class 12 IP. In this article we will discuss some questions and answers from MySQL Functions chapter. Here we go!!

Important QnA MySQL Functions class 12 IP

Objective Type Questions (1 Mark)

Fill in the blanks – MySQL Functions class 12 IP

  1. A __________ is pre-defined set of commands that is used to perform a specific task and return values.
  2. The values that are provided to function is called __________ or __________.
  3. The ___________ functions allows to manipulate the text from table or string passed as parameter to the function.
  4. The ___________ function returns the character for the passed integer number.
  5. To display a specific word from a text, __________ function is used.
  6. The ____________ function removes leading extra spaced from the text.
  7. To know the length of specified text, the __________ function is used.
  8. The ___________ function accepts numeric values and returns numerical values as well.
  9. The ___________ function returns remainder of specified two numbers.
  10. A _________ MySQL function returns square of the given number.
  11. Mr. Kalpesh wants to ignore the fractional part of the number. A ___________ function will help him to serve his purpose.
  12. To know the square root of the given number in MySQL ___________ function will be used.
  13. The ___________ function returns only specified digits from the given digits.
  14. To convert the first letter of each word into capital, MySQL provides ____________ function.

Answers:

  1. function
  2. parameters, arguments
  3. text/string
  4. char()
  5. substr() or substring() or mid()
  6. ltrim()
  7. length()
  1. Numeric
  2. mod()
  3. pow()/power()
  4. round()
  5. sqrt()
  6. truncate()

MCQs – MySQL Functions class 12 IP

  1. Which following is not a category of MySQL functions?
    1. Text Functions
    2. Mathematical Functions
    3. Statistical Functions
    4. Arithmetic Functions
  2. What is the output – select concat(5,5) :
    1. 55
    2. 10
    3. 5
    4. 25
  3. Suppose playername and rank are the columns of an ODI_RANKING table. The user wants to print a record in this manner: Virat Kohli is ranked First. Where Virat Kohli is the player name and First is rank. Which of the following is the correct statement for the same:
    1. select concat(playername, ” is ranked “, rank) from ODI_RANKING where rank=”First”;
    2. select concat(concat(playername, ” is ranked “),rank) from ODI_RANKING where rank = “First”;
    3. select concat(concat(playername, ” is ranked “),rank) where rank = “First” from ODI_RANKING ;
    4. All of these
  4. What is the output of – select char(73,67,69); –
    1. ICE
    2. CAT
    3. ACE
    4. ECE
  5. Which of the following function can be used as lower(); –
    1. lowercase()
    2. lower_case()
    3. lcase()
    4. l_case()
  6. What will be the output of – select substr(“Year2020”,4,4) –
    1. 2020
    2. Year
    3. r202
    4. None of these
  7. What will the output of – select round(12345.678,0); –
    1. 12345
    2. 12346
    3. 12350
    4. 12346.0
  8. What will be returned by sign(-15)
    1. -15
    2. -1
    3. Negative 15
    4. 15

Answers

  1. 4 Arithmetic Function
  2. 1 55
  3. Option 2
  4. 1 ICE
  1. 3 lcase()
  2. 3 r202
  3. 2 12346
  4. 2 -1

True/False – MySQL Functions class 12 IP

  1. Text functions cannot accept numbers as arguments. – False
  2. The concat() function make additions for two numbers. – False
  3. The substr() and instr() function returns similar output. – False
  4. The trim() function removes extra leading and trailing spaces from the text. – True
  5. The instr() function returns the index position of the specified word from selected string or text.
  6. The length() function ignore blank spaces from the text. – False
  7. When the string or text is null, length() function counts null as 1 character. – False
  8. The mid() function is synonym for substring() function. – True
  9. round() and truncate() functions returns the similar values. – False
  10. The sign() function returns the number with sign only. – False

Click here to see IP index page

Short answer questions – MySQL Functions class 12 IP

Consider the following table products and write answers for below given questions:

PcodePnameQtyPriceCompany
P1001iPad12015000Apple
P1002LED TV10085000Sony
P1003DSLR Camera1025000Philips
P1004iPhone5095000Apple
P1005LED TV2045000MI
P1006Bluetooth Speaker10020000Ahuja
  1. Write the output of the following queries:
    1. select lcase(pname) from products where pname=’LED TV’;
    2. select sqrt(price) from products where price>50000;
    3. select mod(qty,3) from products;
    4. select substr(company,1,4) from products;
    5. select concat(concat(pname,”-“),qty) from products where compnany=’Apple’;
    6. select pname,truncate(mod(price,103)) from products where qty>100;
    7. select pcode, round(qty) from products where company in (‘Sony’,’MI’);
    8. select right(pname,4) from products where qty =10 or qty=20;

Try to write answers in comment section.

The next section for MySQL Functions class 12 IP contains query based questions.

  1. Write queries do display:
    1. To join product and company and display in tabular form like – iPad manufatured by Apple
    2. Convert all product named into capital
    3. Count total number of letters for all company.
    4. Display the cube of products quantity for more than or 100 in quantity.
    5. Remove P from the product and display the number in first resultant column, in second resultant column divide the remaining number by 3 and display number with 1 fraction digit.
    6. Display pname, qty, price with 2 decimal points and company for price in between 30000 to 80000.

Try to write these queries yourself and comment your answers.

Thank you for vising my blog.

Share the article MySQL Functions class 12 IP with your classmates. and feel free to ask your doubts in the comment section.

Click here to read notes

Unlock following and download the pdf.

6 thoughts on “Important QnA MySQL Functions class 12 IP”
    1. Rishita Maurya says:

      +——————————-+
      | concat(concat(pname,”-“),qty) |
      +——————————-+
      | IPAD-120 |
      | IPHONE-50 |
      +——————————-+

  1. select lcase(pname) from products where pname=’LED TV’;

    lcase(pname)
    led tv

    select pow(price,1) from products where price>50000;

    pow(price,1) 
    85000
    95000

    select mod(qty,3) from products;

    mod(qty,3) 
    0
    1
    1
    2
    2
    1

    select substr(company,1,4) from products;

    substr(company,1,4)
    APPL
    SONY
    PHIL
    APPL
    MI
    AHUJ

    select concat(concat(pname,’-‘),qty) from products where company=’Apple’;

    concat(concat(pname,’-‘),qty)
    iPad-120
    iPhone-50

    select pname,round(mod(price,103)) from products where qty>100;

    pname round(mod(price,103))
    iPad 65

    select pcode, round(qty) from products where company in (‘Sony’,’MI’);

    pcode round(qty)
    P1002 100
    P1005 20

    select right(pname,4) from products where qty =10 or qty=20;

    right(pname,4)
    ra
    D TV

Leave a Reply