mod3 SQL Basics: Up and Down Given a table of random numbers as follows: numbers table schema id number1 number2 Your job is to return table with similar structure and headings, where if the sum of a column is odd, the column shows the minimum value for that column, and when the sum is even, it shows the max value. You must use a case statement. output table schema number1 number2 Solution: SELECT CASE WHEN MOD(SUM(number1).. 2022. 6. 21. Grasshopper - Check for factor This function should test if the factor is a factor of base. Return true if it is a factor or false if it is not. About factors Factors are numbers you can multiply together to get another number. 2 and 3 are factors of 6 because: 2 * 3 = 6 You can find a factor by dividing numbers. If the remainder is 0 then the number is a factor. You can use the mod operator (%) in most languages to check for.. 2022. 5. 26. SQL Basics: Mod Given the following table 'decimals': ** decimals table schema ** id number1 number2 Return a table with one column (mod) which is the output of number1 modulus number2. Solution: SELECT MOD(number1, number2) FROM decimals; MOD is a function that calculates the remainder when number1 and number2 are divided. 2022. 5. 14. 이전 1 다음