0
0
MySQLquery~10 mins

ABS and MOD in MySQL - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to get the absolute value of -15.

MySQL
SELECT [1](-15) AS absolute_value;
Drag options to blanks, or click blank then click option'
AMOD
BROUND
CSQRT
DABS
Attempts:
3 left
💡 Hint
Common Mistakes
Using MOD instead of ABS, which calculates remainder, not absolute value.
Using SQRT which calculates square root, not absolute value.
2fill in blank
medium

Complete the code to find the remainder when 29 is divided by 5.

MySQL
SELECT [1](29, 5) AS remainder;
Drag options to blanks, or click blank then click option'
AABS
BDIV
CMOD
DROUND
Attempts:
3 left
💡 Hint
Common Mistakes
Using ABS which returns absolute value, not remainder.
Using DIV which returns integer division result, not remainder.
3fill in blank
hard

Fix the error in the code to correctly get the absolute value of a column named 'score'.

MySQL
SELECT [1](score) FROM results;
Drag options to blanks, or click blank then click option'
AABS
BROUND
CSQRT
DMOD
Attempts:
3 left
💡 Hint
Common Mistakes
Using MOD which calculates remainder, not absolute value.
Using SQRT which calculates square root, not absolute value.
4fill in blank
hard

Fill both blanks to calculate the absolute value of the remainder when 17 is divided by 4.

MySQL
SELECT [1]([2](17, 4)) AS result;
Drag options to blanks, or click blank then click option'
AABS
BMOD
CROUND
DSQRT
Attempts:
3 left
💡 Hint
Common Mistakes
Reversing the order of functions.
Using SQRT or ROUND instead of ABS.
5fill in blank
hard

Fill all three blanks to select the absolute value of the remainder when the column 'value' is divided by 3.

MySQL
SELECT [1]([2]([3], 3)) AS abs_mod FROM data;
Drag options to blanks, or click blank then click option'
AABS
BMOD
Cvalue
DROUND
Attempts:
3 left
💡 Hint
Common Mistakes
Using ROUND instead of MOD or ABS.
Using a wrong column name.