Home >Database >Mysql Tutorial >mysql drop table 删除表实例

mysql drop table 删除表实例

WBOY
WBOYOriginal
2016-06-01 09:58:171472browse

先来看一下mysql中drop的语法:

<code class="language-sql">DROP TABLE tableName;</code>

例如我们需要删除数据库中article表,代码如下:

<code>DROP TABLE article;</code>

上面代码并不严谨,如果数据库中没有article表,此时mysql会报错,正确的代码应该这样写:

<code>DROP TABLE if exists article;</code>

好了,关于DROP TABLE 就讲到这里,如需学习更多MYSQL知识,可以参考本站《MYSQL 教程》

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn