You can use SQL for strictly numerical kinds of tasks. Read on for one such...
The
Euclidean Algorithm is a quick way to find the greatest common divisor of two numbers.
Here's how to do it in SQL
WITH RECURSIVE t(a, b) AS (
VALUES (11, 7)
UNION ALL
SELECT least(a, b), abs(a-b) FROM t
WHERE abs(a-b) > 0
)
SELECT a AS gcd FROM t
WHERE a=b;
gcd
---
1
(1 row)
Thanks to Dan Colish for helping debug the above code
P.S. remembered the college