DEV Community

Kelvin Wangonya
Kelvin Wangonya

Posted on

5

You can use your database as a simple calculator

Saw this in the MySQL docs. I'm assuming this only works for relational databases.

I don't know if it's very useful but definitely interesting.

MariaDB[] > SELECT SIN(PI()/4), (4+1)*5;
+------------------+---------+
| SIN(PI()/4)      | (4+1)*5 |
+------------------+---------+
| 0.70710678118655 |      25 |
+------------------+---------+
1 row in set (0.02 sec)
Enter fullscreen mode Exit fullscreen mode
postgres=# SELECT SIN(PI()/4), (4+1)*5;
        sin         | ?column?
--------------------+----------
 0.7071067811865475 |       25
(1 row)
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay