您的位置:首页 > 数据库

SQL常用基础语句-增删改查

2017-07-06 23:30 417 查看
一、增

插入新的单行

inset intto <表名> (列名) values(列值)

例:insert into Students(姓名,性别,出生日期) values(‘张三’,‘男’,‘1990/1/1’)

二、删

删除满足条件的一行

delete from <表名> where <删除条件>

例:delete from Students where name='张三'

三、改

更新满足条件的行

update <表名> set <列名=新值> where <更新条件>

例:update Students set 出生日期= 1990/2/2 where 姓名=‘张三’

四、查

查询表中所有数据行和列

select * from <表名>

例:select * from Students

查询表中满足条件的行列

select <列名> from <表名> where <查询条件>

例:select 姓名,性别 from Students where 出生日期=‘1990/2/2’
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: