MySQL Database Quiz Questions

Course Name:MySQL
Chapter Name:Chapter 7 - DQL (Data Query Language)
Lesson Content Link:NUMERIC functions
Current Quiz Count:30
Progress
0%
Q1
True / False

MySQL's ABS function returns the absolute value of a given number.

Q2
True / False

MySQL's CEIL function always rounds down to the nearest integer.

Q3
True / False

In MySQL, the MOD function calculates the modulus (remainder) of two numbers.

Q4
True / False

MySQL's FLOOR function returns the largest integer less than or equal to a given number.

Q5
True / False

In MySQL, the ROUND function can take a second argument to specify the number of decimal places to round to.

Q6
True / False

MySQL's RAND function generates a random integer between 0 and 1.

Q7
True / False

MySQL's SIGN function returns -1 for negative numbers, 1 for positive numbers, and 0 for zero.

Q8
True / False

In MySQL, the POW function can be used as an alias for the POWER function to raise a number to a specified power.

Q9
True / False

MySQL's TRUNCATE function always rounds a number to the nearest integer.

Q10
True / False

In MySQL, the FORMAT function is used to format a number as a string, including thousands separators and an optional number of decimal places.

Q11
Single Choice

Which MySQL numeric function is used to return the absolute value of a number?

Q12
Single Choice

What does the MySQL function CEIL(4.3) return?

Q13
Single Choice

What is the result of SELECT ROUND(7.56, 1); in MySQL?

Q14
Single Choice

Given the following SQL code, what will SELECT MOD(17, 3); return in MySQL?

Q15
Single Choice

Which MySQL numeric function returns the value of a number raised to the power of another number?

Q16
Single Choice

What will the following MySQL code return: SELECT FLOOR(9.99);?

Q17
Single Choice

What is the output of the following SQL query: SELECT TRUNCATE(123.4567, 2);?

Q18
Single Choice

Which numeric function would you use in MySQL to return the square root of a number?

Q19
Single Choice

Consider the following query: SELECT SIGN(-123); What does it return?

Q20
Single Choice

What will be the result of the following query: SELECT CEIL(ROUND(4.567, 1) + MOD(15, 4));?

Q21
Multiple Choice

Which SQL query uses the ROUND() function to round the prices to 2 decimal places?

SQL Code
SELECT product_name, ROUND(price, 2) AS rounded_price
FROM products;
Q22
Multiple Choice

Identify the SQL query that uses the CEIL() function to return the smallest integer greater than or equal to the product price.

SQL Code
SELECT product_name, CEIL(price) AS ceil_price
FROM products;
Q23
Multiple Choice

Which SQL query uses the FLOOR() function to return the largest integer less than or equal to the product price?

SQL Code
SELECT product_name, FLOOR(price) AS floor_price
FROM products;
Q24
Multiple Choice

Determine the SQL query that uses the MOD() function to find the remainder when the product ID is divided by 5.

SQL Code
SELECT product_name, MOD(product_id, 5) AS remainder
FROM products;
Q25
Multiple Choice

Which SQL query uses the ABS() function to return the absolute value of the product discount?

SQL Code
SELECT product_name, ABS(discount) AS absolute_discount
FROM products;
Q26
Multiple Choice

Which SQL query uses the POWER() function to raise the product price to the power of 3?

SQL Code
SELECT product_name, POWER(price, 3) AS price_cubed
FROM products;
Q27
Multiple Choice

Identify the SQL query that uses the SQRT() function to find the square root of the product price.

SQL Code
SELECT product_name, SQRT(price) AS sqrt_price
FROM products;
Q28
Multiple Choice

Which SQL query uses the LOG() function to return the natural logarithm of the product price?

SQL Code
SELECT product_name, LOG(price) AS natural_log
FROM products;
Q29
Multiple Choice

Determine the SQL query that uses the EXP() function to return the exponential value of the product price.

SQL Code
SELECT product_name, EXP(price) AS exponential_value
FROM products;
Q30
Multiple Choice

Which SQL query uses the SIGN() function to return the sign of the product's stock level?

SQL Code
SELECT product_name, SIGN(stock) AS stock_sign
FROM products;