Home > Database > Mysql Tutorial > mysql学习之五:sql语句学习3_MySQL

mysql学习之五:sql语句学习3_MySQL

WBOY
Release: 2016-06-01 13:16:16
Original
860 people have browsed it

好吧,大家觉得这种字体还是比较好看,所有我们就换这种字体了。

INSERT INTO 语句用于向表格中插入新的行。

语法

<strong>INSERT INTO 表名称 VALUES (&#20540;1, &#20540;2,....)</strong>
Copy after login

我们也可以指定所要插入数据的列:

<strong>INSERT INTO table_name (列1, 列2,...) VALUES (&#20540;1, &#20540;2,....)</strong>
Copy after login

Update 语句用于修改表中的数据。

语法:

<strong>UPDATE 表名称 SET 列名称 = 新&#20540; WHERE 列名称 = 某&#20540;</strong>
Copy after login

DELETE 语句用于删除表中的行。

语法

<strong>DELETE FROM 表名称 WHERE 列名称 = &#20540;</strong>
Copy after login

删除某行

"Fred Wilson" 会被删除:

<strong>DELETE FROM Person WHERE LastName = 'Wilson' </strong>
Copy after login

删除所有行

可以在不删除表的情况下删除所有的行。这意味着表的结构、属性和索引都是完整的:

<strong>DELETE FROM table_name</strong>或者:<strong>DELETE * FROM table_name</strong>
Copy after login
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template