2020年11月13日
摘要: 子查询 1、单行子查询: 例如:select * from emp where sal>(select sal from emp where ename = 'ALLEN'); 2、多行子查询:any all in 大于any就是大于最小值 select * from emp where sal>a 阅读全文
posted @ 2020-11-13 23:24 史振兴 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 一、去重distinct 语法格式:select distinct 列名称 from 表名称 二、统计函数 avg(x) count(1) count(*) max(x) min(x) sum(x) stddev(x) 求一组行中列x值的标准差 variance(x) 求一组行中列x值的方差 rou 阅读全文
posted @ 2020-11-13 23:15 史振兴 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 一、DELETE:属于DML语句。删除数据库中指定条件的数据,相应语法: delete from 表名 where a = b ; (可以加条件的删除) delete from 表名;删除所有行的数据,不能删除某列的值。 执行该语句后,需要使用commit进行提交才能反映到数据库中。 二、事务的四个 阅读全文
posted @ 2020-11-13 23:02 史振兴 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 一、外键(foreign key):constraint , refenerces 例如:sno number(7) constraint fk_sno references student(sno), 二、删除(都属于DDL语句) drop table; 将表结构和表内数据一并删除。(删除表) t 阅读全文
posted @ 2020-11-13 22:52 史振兴 阅读(208) 评论(0) 推荐(0) 编辑