提交 e3d7a27c 编写于 作者: M Mars Liu

functions for date and time

上级 6b6fe5df
{ {
"node_id": "mysql-a7006c27131d4b87817a59717db7021c", "node_id": "mysql-a7006c27131d4b87817a59717db7021c",
"keywords": [], "keywords": [
"datetime",
"timestame",
"date",
"time",
"year",
"month",
"day",
"hour",
"minute",
"second",
"microsecond"
],
"children": [], "children": [],
"export": [ "export": [
"day.json", "day.json",
...@@ -8,7 +20,10 @@ ...@@ -8,7 +20,10 @@
"weekofyear.json", "weekofyear.json",
"weekday.json", "weekday.json",
"to_days.json", "to_days.json",
"now.json" "now.json",
"extract.json",
"timestamp.json",
"from_days.json"
], ],
"keywords_must": [], "keywords_must": [],
"keywords_forbid": [], "keywords_forbid": [],
......
{ {
"type": "code_options", "type": "code_options",
"author": null, "author": "ccat",
"source": "curtime.md", "source": "curtime.md",
"notebook_enable": false, "notebook_enable": false,
"exercise_id": "bc88844a66244492947e98da40709619" "exercise_id": "bc88844a66244492947e98da40709619"
......
{
"type": "code_options",
"author": "ccat",
"source": "extract.md",
"notebook_enable": false,
"exercise_id": "73635de953474af4aa1af6cd90dc8129"
}
\ No newline at end of file
# EXTRACT
关于 Extract 操作和其它日期时间函数的对应关系,下列说法正确的是:
1. `extract(mirosecond from date)` 相当于 `ms(date)`
2. `extract(second from date)` 相当于 `second(date)`
3. `extract(minute from date)` 相当于 `minute(date)`
4. `extract(hour from date)` 相当于 `hour(date)`
5. `extract(day from date)` 相当于 `day(date)`
6. `extract(week from date)` 相当于 `week(date)`
7. `extract(month from date)` 相当于 `month(date)`
8. `extract(year from date)` 相当于 `year(date)`
## 答案
```
2, 3, 4, 5, 6, 7, 8
```
## 选项
### A
全部都对
### B
```
1, 2, 3, 4
```
### C
全都不对
### D
```
5, 6, 7, 8
```
\ No newline at end of file
{
"type": "code_options",
"author": "ccat",
"source": "from_days.md",
"notebook_enable": false,
"exercise_id": "cda783def29f4431979121e05498690c"
}
\ No newline at end of file
# FROM_DAYS
FROM_DAYS 函数返回的是?
## 答案
给定从 0000 年 1 月 1 日起的天数,返回对应的日期
## 选项
### A
给定从 1970 年 1 月 1 日起的天数,返回对应的日期
### B
都不对
### C
给定从当前日期算起的天数,返回对应的日期
{
"type": "code_options",
"author": "ccat",
"source": "timestamp.md",
"notebook_enable": false,
"exercise_id": "680153b527564dffaa026c8130e388f3"
}
\ No newline at end of file
# TIMESTAMP
关于 UNIX 时间戳和 MySQL 的日期时间类型,以下说法正确的是:
1. UNIX_TIMESTAMP(date) 函数将 date 转换为 UNIX 时间戳
2. FROM_UNIXTIME(timestamp) 将 UNIX 时间戳 timestamp 转换为 date 类型
3. extract(timestamp from date) 可以将 date 转换为 Unix 时间戳
4. extract(datetime from timestamp) 可以将时间戳转换为 datetime
## 答案
```
1, 2
```
## 选项
### A
全部都对
### B
全都不对
### C
```
3, 4
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册