Skip to content

Instantly share code, notes, and snippets.

@pushcx
Last active March 9, 2026 16:38
Show Gist options
  • Select an option

  • Save pushcx/4a25100ce70ba1aa51a1d3e3f083060e to your computer and use it in GitHub Desktop.

Select an option

Save pushcx/4a25100ce70ba1aa51a1d3e3f083060e to your computer and use it in GitHub Desktop.
MariaDB [lobsters]> SELECT user_is_author, MIN(score), AVG(score), MAX(score), STDDEV(score) FROM
-> stories GROUP BY user_is_author;
+----------------+------------+------------+------------+---------------+
| user_is_author | MIN(score) | AVG(score) | MAX(score) | STDDEV(score) |
+----------------+------------+------------+------------+---------------+
| 0 | -22 | 12.3296 | 341 | 16.1358 |
| 1 | -9 | 15.9859 | 472 | 21.5062 |
+----------------+------------+------------+------------+---------------+
MariaDB [lobsters]> SELECT user_is_author, MIN(score), AVG(score), MAX(score), STDDEV(score), count(*) FROM stories GR
OUP BY user_is_author;
+----------------+------------+------------+------------+---------------+----------+
| user_is_author | MIN(score) | AVG(score) | MAX(score) | STDDEV(score) | count(*) |
+----------------+------------+------------+------------+---------------+----------+
| 0 | -22 | 12.3296 | 341 | 16.1358 | 99535 |
| 1 | -9 | 15.9859 | 472 | 21.5062 | 23972 |
+----------------+------------+------------+------------+---------------+----------+
2 rows in set (0.152 sec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment