0% found this document useful (0 votes)
7 views

functions

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

functions

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Question 1

Which function can be used to concatenate two strings ?

The CONCAT() function is used to concatenate two strings in a query result.

Question 2

Which function(s) can be used for extracting a substrings ?

The SUBSTRING()/SUBSTR() and MID() functions can be used for extracting a


substrings.

Question 3

What is the difference between Trim() and Rtrim() ?

Question 4

What is the difference between round() and truncate() ?

Question 5

Which function returns the current date and current time ?

The NOW() function returns the current date and current time.

Question 6

What is the difference between sysdate() and now() functions ?

Multiple Choice Questions

Question 1

A function working with every row of a table, is a ............... function.

1. Aggregate

2. Single value

3. Single row

4. Summary

Question 2

Which of the following is not a text function ?

1. TRIM()
2. TRUNCATE()

3. LEFT()

4. MID()

Question 3

Which of the following is not a numeric function ?

1. MOD

2. SIGN

3. MID

4. POW

Question 4

Which of the following is not a date function ?

1. Month

2. Year

3. NOW

4. POW

Question 5

Which of the following functions returns the substring from a given string ?

1. MID

2. INSTR

3. SUBSTR

4. CHAR

Question 6

Which of the following functions returns the position of a substring in a given


string ?

1. MID

2. INSTR
3. SUBSTR

4. CHAR

Question 7

Which one of the following is not an aggregate function ?

1. ROUND()

2. SUM()

3. COUNT()

4. AVG()

Question 8

Which of the following SQL functions does not belong to the Math functions
category ?

1. POWER()

2. ROUND()

3. LENGTH()

4. MOD()

Question 9

Which of the following is not a valid aggregate function in MYSQL ?

1. COUNT()

2. SUM()

3. MAX()

4. LEN()

Question 10

What will be printed by the given query ?

SELECT LENGTH("WINNER");

1. 7

2. 6

3. 8
4. 9

Question 11

What will be returned by the given query ?

SELECT INSTR("INDIA", "DI");

1. 2

2. 3

3. -2

4. -3

Question 12

If the substring is not present in a string, the INSTR() returns:

1. -1

2. 1

3. NULL

4. 0

Question 13

What will be returned by the given query ?

SELECT concat("It", "was", "ok");

1. "It was ok"

2. "It wasok"

3. "Itwasok"

4. "Itwas ok"

Question 14

Predict the output of the following query :

SELECT LCASE(MONTHNAME('2023-03-05'));

1. May

2. March

3. may
4. march

Question 15

To remove the leading and trailing space from data values in a column of
MySQL Table, we use

1. Left()

2. Right()

3. Trim()

4. Ltrim()

Question 16

What will be returned by the given query ?

SELECT Round(153.669, 2);

1. 153.6

2. 153.66

3. 153.67

4. 153.7

Question 17

What will be returned by the given query ?

SELECT Sign(26);

1. 1

2. -1

3. 0

4. none of these

Question 18

What will returned by the given query ?

SELECT Truncate(15.79, -1), Truncate(15.79, 0), Truncate(15.79, 1);

1. 15 15 15.7

2. 10 15.7 15.9
3. 10 15 15.7

4. 10 10 15.9

You might also like