提交 4b202716 编写于 作者: M Mars Liu

regex

上级 f5593648
{ {
"type": "code_options", "type": "code_options",
"author": null, "author": "Mars",
"source": "create_function.md", "source": "create_function.md",
"notebook_enable": false, "notebook_enable": false,
"exercise_id": "213471661dd244f58bd0d2e0928a0100" "exercise_id": "213471661dd244f58bd0d2e0928a0100"
......
{ {
"node_id": "mysql-af89d54d66974111b4f67aeba2af7161", "node_id": "mysql-af89d54d66974111b4f67aeba2af7161",
"keywords": ["engine", "innodb", "myisam"], "keywords": [
"engine",
"innodb",
"myisam"
],
"children": [], "children": [],
"export": [], "export": [
"upgrade_engine.json"
],
"keywords_must": [ "keywords_must": [
["mysql", "存储引擎"] [
"mysql",
"存储引擎"
]
] ]
} }
\ No newline at end of file
{
"type": "code_options",
"author": "ccat",
"source": "upgrade_engine.md",
"notebook_enable": false,
"exercise_id": "87ceaa4ffe494e219ff20c91eee8a2ec"
}
\ No newline at end of file
# 存储引擎修改
Goods 表的存储引擎是 MyISAM,Joe 需要把它修改为 InnoDB,他应该怎么做?
## 答案
```mysql
alter table goods engine innodb;
```
## 选项
### A
```mysql
alter table goods set engine innodb;
```
### B
1. 将 goods 表的数据导出
2. 重建 goods 表,建表时指定 `engine=innodb`
3. 导入数据
### C
```mysql
alter table goods add engine innodb;
```
### D
所有都不对
\ No newline at end of file
{ {
"node_id": "mysql-2296dbe96d584a52bd28a3ad5f655518", "node_id": "mysql-2296dbe96d584a52bd28a3ad5f655518",
"keywords": [], "keywords": ["where"],
"children": [], "children": [],
"export": [ "export": [
"between.json" "between.json"
......
{ {
"node_id": "mysql-8e6cd4d5f4b446a2bc3f5402de9bd49c", "node_id": "mysql-8e6cd4d5f4b446a2bc3f5402de9bd49c",
"keywords": [ "keywords": [
"when",
"case", "case",
"pivot", "pivot",
"透视表" "透视表"
......
{ {
"node_id": "mysql-fa20a81805b44975aed265dd058c542a", "node_id": "mysql-fa20a81805b44975aed265dd058c542a",
"keywords": [], "keywords": ["order by", "排序"],
"children": [], "children": [],
"export": [ "export": [
"order_by.json" "order_by.json"
......
{ {
"node_id": "mysql-e6cbbff27cd04bc0b61ebbb3ef27d4b2", "node_id": "mysql-e6cbbff27cd04bc0b61ebbb3ef27d4b2",
"keywords": ["regex", "regular"], "keywords": [
"regex",
"regular"
],
"children": [], "children": [],
"export": [], "export": [
"regex.json"
],
"keywords_must": [ "keywords_must": [
["mysql", "正则表达式"] [
"mysql",
"正则表达式"
]
], ],
"keywords_forbid": [], "keywords_forbid": [],
"group": 0 "group": 0
......
{
"type": "code_options",
"author": "ccat",
"source": "regex.md",
"notebook_enable": false,
"exercise_id": "1b35ec1703954c42be54d361a97ca3d9"
}
\ No newline at end of file
# 正则表达式
Joe 想要找出 goods 表中所有名称包含牛奶的冰激凌,他应该怎么写这个查询?
## 答案
```mysql
select *
from goods
where name regexp '牛奶.*冰激凌';
```
## 选项
### A
```mysql
select *
from goods
where name like '牛奶%冰激凌'
```
### B
```mysql
select *
from goods
where name like '牛奶.*冰激凌';
```
### C
```mysql
select *
from goods
where name regexp '牛奶冰激凌';
```
### D
所有都不对
\ No newline at end of file
{ {
"type": "code_options", "type": "code_options",
"author": null, "author": "Mars",
"source": "distrubute.md", "source": "distrubute.md",
"notebook_enable": false, "notebook_enable": false,
"exercise_id": "815be880ae8141f9b562638e167dcedb" "exercise_id": "815be880ae8141f9b562638e167dcedb"
......
...@@ -758,7 +758,9 @@ ...@@ -758,7 +758,9 @@
{ {
" WHERE": { " WHERE": {
"node_id": "mysql-2296dbe96d584a52bd28a3ad5f655518", "node_id": "mysql-2296dbe96d584a52bd28a3ad5f655518",
"keywords": [], "keywords": [
"where"
],
"children": [], "children": [],
"keywords_must": [ "keywords_must": [
[ [
...@@ -774,6 +776,7 @@ ...@@ -774,6 +776,7 @@
"CASE": { "CASE": {
"node_id": "mysql-8e6cd4d5f4b446a2bc3f5402de9bd49c", "node_id": "mysql-8e6cd4d5f4b446a2bc3f5402de9bd49c",
"keywords": [ "keywords": [
"when",
"case", "case",
"pivot", "pivot",
"透视表" "透视表"
...@@ -809,7 +812,10 @@ ...@@ -809,7 +812,10 @@
{ {
"ORDER BY": { "ORDER BY": {
"node_id": "mysql-fa20a81805b44975aed265dd058c542a", "node_id": "mysql-fa20a81805b44975aed265dd058c542a",
"keywords": [], "keywords": [
"order by",
"排序"
],
"children": [], "children": [],
"keywords_must": [ "keywords_must": [
[ [
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册