理系学生日記

おまえはいつまで学生気分なのか

忍者TOOLS

Chapter 7: Excersises

7-1

mysql> SELECT SUBSTRING('Please find the substring in this string.', 17, 25-17+1);
+---------------------------------------------------------------------+
| SUBSTRING('Please find the substring in this string.', 17, 25-17+1) |
+---------------------------------------------------------------------+
| substring                                                           |
+---------------------------------------------------------------------+

7-2

mysql> SELECT ABS(-25.76823), SIGN(-25.76823), ROUND(25.76823, -2);
+----------------+-----------------+---------------------+
| ABS(-25.76823) | SIGN(-25.76823) | ROUND(25.76823, -2) |
+----------------+-----------------+---------------------+
|       25.76823 |              -1 |                   0 |
+----------------+-----------------+---------------------+

7-3

mysql> SELECT EXTRACT(MONTH FROM CURRENT_DATE());
+------------------------------------+
| EXTRACT(MONTH FROM CURRENT_DATE()) |
+------------------------------------+
|                                  8 |
+------------------------------------+