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

mysql drop table 删除表实例

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 09:58:17
Original
1503 people have browsed it

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

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

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

<code>DROP TABLE article;</code>
Copy after login

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

<code>DROP TABLE if exists article;</code>
Copy after login

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

Related labels:
source:php.cn
Statement of this Website
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
Latest Issues
MySQL stops process
From 1970-01-01 08:00:00
0
0
0
Error when installing mysql on linux
From 1970-01-01 08:00:00
0
0
0
phpstudy cannot start mysql?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template