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!!
Topics Covered
Important QnA MySQL Functions class 12 IP
Objective Type Questions (1 Mark)
Fill in the blanks – MySQL Functions class 12 IP
- A __________ is pre-defined set of commands that is used to perform a specific task and return values.
- The values that are provided to function is called __________ or __________.
- The ___________ functions allows to manipulate the text from table or string passed as parameter to the function.
- The ___________ function returns the character for the passed integer number.
- To display a specific word from a text, __________ function is used.
- The ____________ function removes leading extra spaced from the text.
- To know the length of specified text, the __________ function is used.
- The ___________ function accepts numeric values and returns numerical values as well.
- The ___________ function returns remainder of specified two numbers.
- A _________ MySQL function returns square of the given number.
- Mr. Kalpesh wants to ignore the fractional part of the number. A ___________ function will help him to serve his purpose.
- To know the square root of the given number in MySQL ___________ function will be used.
- The ___________ function returns only specified digits from the given digits.
- To convert the first letter of each word into capital, MySQL provides ____________ function.
Answers:
- function
- parameters, arguments
- text/string
- char()
- substr() or substring() or mid()
- ltrim()
- length()
- Numeric
- mod()
- pow()/power()
- round()
- sqrt()
- truncate()
MCQs – MySQL Functions class 12 IP
- Which following is not a category of MySQL functions?
- Text Functions
- Mathematical Functions
- Statistical Functions
- Arithmetic Functions
- What is the output – select concat(5,5) :
- 55
- 10
- 5
- 25
- 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:
- select concat(playername, ” is ranked “, rank) from ODI_RANKING where rank=”First”;
- select concat(concat(playername, ” is ranked “),rank) from ODI_RANKING where rank = “First”;
- select concat(concat(playername, ” is ranked “),rank) where rank = “First” from ODI_RANKING ;
- All of these
- What is the output of – select char(73,67,69); –
- ICE
- CAT
- ACE
- ECE
- Which of the following function can be used as lower(); –
- lowercase()
- lower_case()
- lcase()
- l_case()
- What will be the output of – select substr(“Year2020”,4,4) –
- 2020
- Year
- r202
- None of these
- What will the output of – select round(12345.678,0); –
- 12345
- 12346
- 12350
- 12346.0
- What will be returned by sign(-15)
- -15
- -1
- Negative 15
- 15
Answers
- 4 Arithmetic Function
- 1 55
- Option 2
- 1 ICE
- 3 lcase()
- 3 r202
- 2 12346
- 2 -1
True/False – MySQL Functions class 12 IP
- Text functions cannot accept numbers as arguments. – False
- The concat() function make additions for two numbers. – False
- The substr() and instr() function returns similar output. – False
- The trim() function removes extra leading and trailing spaces from the text. – True
- The instr() function returns the index position of the specified word from selected string or text.
- The length() function ignore blank spaces from the text. – False
- When the string or text is null, length() function counts null as 1 character. – False
- The mid() function is synonym for substring() function. – True
- round() and truncate() functions returns the similar values. – False
- The sign() function returns the number with sign only. – False
Short answer questions – MySQL Functions class 12 IP
Consider the following table products and write answers for below given questions:
Pcode | Pname | Qty | Price | Company |
P1001 | iPad | 120 | 15000 | Apple |
P1002 | LED TV | 100 | 85000 | Sony |
P1003 | DSLR Camera | 10 | 25000 | Philips |
P1004 | iPhone | 50 | 95000 | Apple |
P1005 | LED TV | 20 | 45000 | MI |
P1006 | Bluetooth Speaker | 100 | 20000 | Ahuja |
- Write the output of the following queries:
- select lcase(pname) from products where pname=’LED TV’;
- select sqrt(price) from products where price>50000;
- select mod(qty,3) from products;
- select substr(company,1,4) from products;
- select concat(concat(pname,”-“),qty) from products where compnany=’Apple’;
- select pname,truncate(mod(price,103)) from products where qty>100;
- select pcode, round(qty) from products where company in (‘Sony’,’MI’);
- 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.
- Write queries do display:
- To join product and company and display in tabular form like – iPad manufatured by Apple
- Convert all product named into capital
- Count total number of letters for all company.
- Display the cube of products quantity for more than or 100 in quantity.
- 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.
- 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.
Unlock following and download the pdf.
plzz update the answers
Answers already available in the notes provided through the link in this article
answers are not available
please tell 5 from the products table
+——————————-+
| concat(concat(pname,”-“),qty) |
+——————————-+
| IPAD-120 |
| IPHONE-50 |
+——————————-+
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