提交 6b6fe5df 编写于 作者: M Mars Liu

functions for date and time

上级 f8c09596
...@@ -3,5 +3,5 @@ ...@@ -3,5 +3,5 @@
"author": "ccat", "author": "ccat",
"source": "create_user.md", "source": "create_user.md",
"notebook_enable": false, "notebook_enable": false,
"exercise_id": "b64ebf99bff14f69b2ef92049bb7b57c" "exercise_id": "70eadd97073640d5ac486898c7294d34"
} }
\ No newline at end of file
{
"node_id": "mysql-a7006c27131d4b87817a59717db7021c",
"keywords": [],
"children": [],
"export": [
"day.json",
"curtime.json",
"weekofyear.json",
"weekday.json",
"to_days.json",
"now.json"
],
"keywords_must": [],
"keywords_forbid": [],
"group": 1
}
\ No newline at end of file
{
"type": "code_options",
"author": null,
"source": "curtime.md",
"notebook_enable": false,
"exercise_id": "bc88844a66244492947e98da40709619"
}
\ No newline at end of file
# 当前时间
Joe 需要在程序中获取当前时间,但是不包含日期部分。下列哪些函数可以提供这个功能?
1. now()
2. curtime()
3. sysdate()
4. current_time()
5. current_timestamp()
## 答案
```
2, 4
```
## 选项
### A
```
1, 2, 3, 4
```
### B
全都可以
### C
全部都错
### D
```
4, 5
```
### E
```
1, 2
```
{
"type": "code_options",
"author": "ccat",
"source": "day.md",
"notebook_enable": false,
"exercise_id": "b64ebf99bff14f69b2ef92049bb7b57c"
}
\ No newline at end of file
# DAY
Joe 需要从日期中提取当天是几号,下列哪些函数可以实现这个功能?
1. DAY
2. DAYOFMONTH
3. DAYOFYEAR
4. TO_DAYS
## 答案
1 和 2
## 选项
### A
只有 1
### B
只有 2
### C
都不对
### D
全都可以
\ No newline at end of file
{
"type": "code_options",
"author": "ccat",
"source": "now.md",
"notebook_enable": false,
"exercise_id": "f628db00fb904159a301551adc981d78"
}
\ No newline at end of file
# 当前时间
Joe 在程序中获取当前时间,下面哪个函数*不*能满足要求?
1. now()
2. sysdate()
3. CURRENT_TIMESTAMP()
4. LOCALTIME()
5. current()
## 答案
5
## 选项
### A
1
### B
2
### C
3
### D
4
{
"type": "code_options",
"author": "ccat",
"source": "to_days.md",
"notebook_enable": false,
"exercise_id": "c48b730d0d0f4347969e1c9375efd3c1"
}
\ No newline at end of file
# TO_DAYS
TO_DAYS 函数返回的是?
## 答案
给定时间到 0000 年 1 月 1 日的天数。
## 选项
### A
给定时间到 1970 年 1 月 1 日的天数。
### B
都不对
### C
当前时间到 0000 年 1 月 1 日的天数。
### D
当前时间到 1970 年 1 月 1 日的天数。
{
"type": "code_options",
"author": "ccat",
"source": "weekday.md",
"notebook_enable": false,
"exercise_id": "92dc6edd3bbb43969147763a3298bbea"
}
\ No newline at end of file
# WeekDay
Joe 想要用 weekday 生成每周分析报表,这个函数会将如期映射为整数,当 weekday 返回 0 ,代表周几?
## 答案
周一
## 选项
### A
周日
### B
周六
### C
全都不是
### D
视时区不同而变
\ No newline at end of file
{
"type": "code_options",
"author": "ccat",
"source": "now.md",
"notebook_enable": false,
"exercise_id": "5ef9bfa0d9b34219941e4b833fa54e77"
}
\ No newline at end of file
# WEEK OF YEAR
下列函数中,哪些可以获取给定时间在一年中的第几周?
1. week
2. weekofyear
3. weekday
4. dayofyear
5. dayofweek
## 答案
```
1, 2
```
## 选项
### A
```
1, 2, 3, 4
```
### B
全部都是
### C
全都不是
### D
```
1, 2, 3, 5
```
\ No newline at end of file
{ {
"type": "code_options", "type": "code_options",
"author": null, "author": "Mars",
"source": "dump.md", "source": "dump.md",
"notebook_enable": false, "notebook_enable": false,
"exercise_id": "d581e2fe632b4737b6da553bd6455ed7" "exercise_id": "d581e2fe632b4737b6da553bd6455ed7"
......
...@@ -836,7 +836,7 @@ ...@@ -836,7 +836,7 @@
} }
}, },
{ {
"系统函数": { "内置函数": {
"node_id": "mysql-f436539236694bb9a4014de11e06ad82", "node_id": "mysql-f436539236694bb9a4014de11e06ad82",
"keywords": [], "keywords": [],
"children": [ "children": [
...@@ -889,6 +889,16 @@ ...@@ -889,6 +889,16 @@
"group": 0 "group": 0
} }
}, },
{
"时间日期函数": {
"node_id": "mysql-a7006c27131d4b87817a59717db7021c",
"keywords": [],
"children": [],
"keywords_must": [],
"keywords_forbid": [],
"group": 1
}
},
{ {
"其它函数": { "其它函数": {
"node_id": "mysql-f2fe15b77d5d4ecb92e2840e8b831af2", "node_id": "mysql-f2fe15b77d5d4ecb92e2840e8b831af2",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册