From 7fc2d5cf17d411121205b69af9d5d4200c8e5c78 Mon Sep 17 00:00:00 2001 From: Mars Liu Date: Fri, 24 Jun 2022 23:36:16 +0800 Subject: [PATCH] add drop table --- .../config.json" | 9 +++- .../drop_table.json" | 7 +++ .../drop_table.md" | 48 +++++++++++++++++++ data/tree.json | 2 +- 4 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 "data/1.MySQL\345\210\235\351\230\266/3.\344\275\277\347\224\250\346\225\260\346\215\256\345\272\223/2.\345\210\233\345\273\272\345\222\214\345\210\240\351\231\244\350\241\250/drop_table.json" create mode 100644 "data/1.MySQL\345\210\235\351\230\266/3.\344\275\277\347\224\250\346\225\260\346\215\256\345\272\223/2.\345\210\233\345\273\272\345\222\214\345\210\240\351\231\244\350\241\250/drop_table.md" diff --git "a/data/1.MySQL\345\210\235\351\230\266/3.\344\275\277\347\224\250\346\225\260\346\215\256\345\272\223/2.\345\210\233\345\273\272\345\222\214\345\210\240\351\231\244\350\241\250/config.json" "b/data/1.MySQL\345\210\235\351\230\266/3.\344\275\277\347\224\250\346\225\260\346\215\256\345\272\223/2.\345\210\233\345\273\272\345\222\214\345\210\240\351\231\244\350\241\250/config.json" index 2a8d371..4e27f71 100644 --- "a/data/1.MySQL\345\210\235\351\230\266/3.\344\275\277\347\224\250\346\225\260\346\215\256\345\272\223/2.\345\210\233\345\273\272\345\222\214\345\210\240\351\231\244\350\241\250/config.json" +++ "b/data/1.MySQL\345\210\235\351\230\266/3.\344\275\277\347\224\250\346\225\260\346\215\256\345\272\223/2.\345\210\233\345\273\272\345\222\214\345\210\240\351\231\244\350\241\250/config.json" @@ -4,10 +4,15 @@ "children": [], "export": [ "create_table.json", - "auto_increment.json" + "auto_increment.json", + "drop_table.json" ], "keywords_must": [ - ["mysql", "创建", "表"] + [ + "mysql", + "创建", + "表" + ] ], "keywords_forbid": [], "group": 1 diff --git "a/data/1.MySQL\345\210\235\351\230\266/3.\344\275\277\347\224\250\346\225\260\346\215\256\345\272\223/2.\345\210\233\345\273\272\345\222\214\345\210\240\351\231\244\350\241\250/drop_table.json" "b/data/1.MySQL\345\210\235\351\230\266/3.\344\275\277\347\224\250\346\225\260\346\215\256\345\272\223/2.\345\210\233\345\273\272\345\222\214\345\210\240\351\231\244\350\241\250/drop_table.json" new file mode 100644 index 0000000..08e455f --- /dev/null +++ "b/data/1.MySQL\345\210\235\351\230\266/3.\344\275\277\347\224\250\346\225\260\346\215\256\345\272\223/2.\345\210\233\345\273\272\345\222\214\345\210\240\351\231\244\350\241\250/drop_table.json" @@ -0,0 +1,7 @@ +{ + "type": "code_options", + "author": "ccat", + "source": "drop_table.md", + "notebook_enable": false, + "exercise_id": "c4e2ce3e42c5454a8d6c520d4a818497" +} \ No newline at end of file diff --git "a/data/1.MySQL\345\210\235\351\230\266/3.\344\275\277\347\224\250\346\225\260\346\215\256\345\272\223/2.\345\210\233\345\273\272\345\222\214\345\210\240\351\231\244\350\241\250/drop_table.md" "b/data/1.MySQL\345\210\235\351\230\266/3.\344\275\277\347\224\250\346\225\260\346\215\256\345\272\223/2.\345\210\233\345\273\272\345\222\214\345\210\240\351\231\244\350\241\250/drop_table.md" new file mode 100644 index 0000000..355a419 --- /dev/null +++ "b/data/1.MySQL\345\210\235\351\230\266/3.\344\275\277\347\224\250\346\225\260\346\215\256\345\272\223/2.\345\210\233\345\273\272\345\222\214\345\210\240\351\231\244\350\241\250/drop_table.md" @@ -0,0 +1,48 @@ +# 删除表 + +Joe 想要删除数据库中的 good_category 表,他应该怎么操作? + +
+ +点击进入[MySQL实战练习环境](https://mydev.csdn.net/product/pod/new?image=cimg-centos7-skilltreemysql&connect=auto&create=auto&utm_source=skill){target="_blank"}。 + +* `show databases;` 列出所有数据库 +* `show tables;` 列出所有表 + +## 答案 + +```mysql +drop table goods_category; +``` + +## 选项 + +### A + +```mysql +delete table good_category; +``` + +### B + +```mysql +delete table where name = 'good_category'; +``` + +### C + +```mysql +remove table good_category; +``` + +### D + +```mysql +truncate table goods_category; +``` + +### E + +```mysql +clean table goods_category; +``` diff --git a/data/tree.json b/data/tree.json index 1d36cbc..4d0867c 100644 --- a/data/tree.json +++ b/data/tree.json @@ -140,7 +140,7 @@ } }, { - "表": { + "创建和删除表": { "node_id": "mysql-426b0b1e04a4462e984ee77ca536f916", "keywords": [], "children": [], -- GitLab