修改表中数据

修改表中数据
格式:
update+表名+set+列名=‘表达式'+where 条件表达式
update student set name='李四' where name ='43'
删除表中数据
格式:
delete + from + 表名 +where 条件表达式
说明:当选项缺省时,删除表中所有数据
delete from student where csrq='1998-1-1'
或者:
格式:
truncate +table +表名
功能:删除表中所有数据
删除表:
drop table 删除表定义及该表的所有数据
语法:
drop table table_name
查询语句
where 查询条件
group by 分组查询
select brand, max(price) from car group by brand 这是通过分组查询
意思是通过brabd进行分组,现在是分成好几个组, 然后通过最高的价格摘出来,相当于把每个牌子的最高价格的车型拿了出来。
分组查询必须跟着函数 这就是函数 max(price)
having 筛选查询
order by 排序
选择特定列
select __ , __ from student
去重查询
distinct语句:
select distinct brand from car
top 句子:
top n [percent] 可以用于查询前几列的数据

原文地址:https://www.cnblogs.com/yunpeng521/p/7076634.html