나는 이렇게 학습한다/Algorithm & SQL

SQL Basics: Mod

daco2020 2022. 5. 14. 21:55
반응형

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.

 

 

반응형

'나는 이렇게 학습한다 > Algorithm & SQL' 카테고리의 다른 글

Collect Tuition (SQL for Beginners #4)  (0) 2022.05.16
Expressions Matter  (0) 2022.05.15
Easy SQL: LowerCase  (0) 2022.05.13
SQL Basics: Simple WHERE and ORDER BY  (0) 2022.05.12
Sum of numbers from 0 to N  (0) 2022.05.11