事务:transaction 事务是一个逻辑工作单元,是一个不可停顿的系列操作。事务处理必须满足acid原则atom consistant,i ,d. 原子,一致性,隔离,持久。
关于select where group by order by 之间的位置
group by 在where 之后 。order by 在最后位置。
查询表s中num最小的记录,不用min函数。
mysql:
select * from s order by num desc limit 1;
查询表s中num最小的记录,用min函数。
mysql:
select * from s where num in (select min(num) from s);
查询表s中num重复的记录。
mysql:
select * from s where num in (select num from s group by num having count(num)>1); //不去重复
select * from s group by num having count(*)>1; // 去重复
begin transaction ... commit / rollback transaction
索引: index 一种可选的与表有关的数据库对象,用来提高数据的查询效率。
存储过程:procedure 是sql 语句和流程控制语句的预编译程序块,是一个程序处理单元。
关于select where group by order by 之间的位置
group by 在where 之后 。order by 在最后位置。
查询表s中num最小的记录,不用min函数。
mysql:
select * from s order by num desc limit 1;
查询表s中num最小的记录,用min函数。
mysql:
select * from s where num in (select min(num) from s);
查询表s中num重复的记录。
mysql:
select * from s where num in (select num from s group by num having count(num)>1); //不去重复
select * from s group by num having count(*)>1; // 去重复
事务、游标、索引、视图、存储过程、触发器等数据库核心概念解析
本文深入探讨了数据库中的事务处理、游标、索引、视图、存储过程、触发器等关键概念,详细解释了它们的功能和使用方法,帮助读者理解并掌握数据库管理的基础知识。
7536

被折叠的 条评论
为什么被折叠?



