Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete 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'
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.
✗ Incorrect
The ABS function returns the absolute value of a number, so ABS(-15) returns 15.
2fill in blank
mediumComplete 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using ABS which returns absolute value, not remainder.
Using DIV which returns integer division result, not remainder.
✗ Incorrect
The MOD function returns the remainder of division, so MOD(29, 5) returns 4.
3fill in blank
hardFix 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using MOD which calculates remainder, not absolute value.
Using SQRT which calculates square root, not absolute value.
✗ Incorrect
Use ABS to get the absolute value of the 'score' column.
4fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Reversing the order of functions.
Using SQRT or ROUND instead of ABS.
✗ Incorrect
First, MOD(17, 4) calculates the remainder (1), then ABS returns its absolute value (1).
5fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using ROUND instead of MOD or ABS.
Using a wrong column name.
✗ Incorrect
MOD(value, 3) calculates remainder, ABS returns absolute value of that remainder.