随笔分类 -  初识Mysql

摘要:多个用while,单个用if 阅读全文
posted @ 2022-07-04 21:07 天井听雨 阅读(19) 评论(0) 推荐(0) 编辑
摘要:注入测试不全(下面测试同理),有空回去看 package com.kuang.lesson02; import com.kuang.lesson02.utils.JdbcUtils; import java.sql.Connection; import java.sql.ResultSet; imp 阅读全文
posted @ 2022-06-29 14:47 天井听雨 阅读(31) 评论(0) 推荐(0) 编辑
摘要:https://www.bilibili.com/video/BV1NJ411J79W?p=40&spm_id_from=333.880.my_history.page.click 口诀:贾琏欲执事(加连预执释) 引入依赖,加载驱动 连接数据库 创建预编译语句 设置参数,执行sql 关闭连接,释放资 阅读全文
posted @ 2022-06-29 14:45 天井听雨 阅读(25) 评论(0) 推荐(0) 编辑
摘要:未敲(idea 数据库未安装成功) 阅读全文
posted @ 2022-06-29 14:45 天井听雨 阅读(12) 评论(0) 推荐(0) 编辑
摘要:https://blog.csdn.net/qq_44870887/article/details/119942721 阅读全文
posted @ 2022-06-29 14:45 天井听雨 阅读(8) 评论(0) 推荐(0) 编辑
摘要:事务 阅读全文
posted @ 2022-06-29 14:44 天井听雨 阅读(9) 评论(0) 推荐(0) 编辑
摘要:http://blog.codinglabs.org/articles/theory-of-mysql-index.html 有机会再了解 MySQL索引背后的数据结构及算法原理 阅读全文
posted @ 2022-06-29 14:42 天井听雨 阅读(4) 评论(0) 推荐(0) 编辑
摘要:创建用户(暂时先了解一下,不深究) 可视化工具直接用,但是lunix 和 服务器只能靠手敲 MYSQL 备份 阅读全文
posted @ 2022-06-29 14:42 天井听雨 阅读(21) 评论(0) 推荐(0) 编辑
摘要:三大范式 ( 背三大,其他了解) https://www.cnblogs.com/yun meng/p/12783304.html 阅读全文
posted @ 2022-06-29 14:42 天井听雨 阅读(15) 评论(0) 推荐(0) 编辑
摘要:https://blog.csdn.net/qq_46489900/article/details/122150056 ACID (背四大原则,其他看一下) -- mysql 默认开启事务自动提交的 (不要执行) set autocommit = 0; /* 关闭 */ set autocommit 阅读全文
posted @ 2022-04-27 10:57 天井听雨 阅读(14) 评论(0) 推荐(0) 编辑
摘要:看看 聚合函数(常用) having 必须放在group by 下面 (因为where不能使用聚集函数,要在having使用) -- 聚合函数 SELECT count(`studentname`)from student -- count(字段)能够自动省略 null 值 select count 阅读全文
posted @ 2022-04-26 22:31 天井听雨 阅读(27) 评论(0) 推荐(0) 编辑
摘要:排序 asc 升序 desc 降序 -- 排序 -- asc 升序 desc 降序 -- orde by 通过哪个字段排序,怎么排 select s.studentno,studentname,subjectname,studentresult from student s INNER JOIN r 阅读全文
posted @ 2022-04-26 15:22 天井听雨 阅读(11) 评论(0) 推荐(0) 编辑
摘要:SQL92是where连接条件 SQL99语法是on 连接条件 记住inner 需要两个表都匹配的数据,left左边的表数据都显示,right右边的表都展示,full两边的表都展示 比如innerjoin:基准是交叉部分,交叉的结果会拿出来,然后把左表和右表中符合的也拿出来 -- inner joi 阅读全文
posted @ 2022-04-25 18:36 天井听雨 阅读(104) 评论(0) 推荐(0) 编辑
摘要:指定字段查询 -- 查询全部学生, select 字段 from 表 select * from student -- 查询指定字段 select `studentno`,`loginpwd` from student -- 别名,给结果起一个名字 select `studentno` as 学号, 阅读全文
posted @ 2022-04-24 13:24 天井听雨 阅读(28) 评论(0) 推荐(0) 编辑
摘要:DML 语言 插入 insert into student(name) values('张三') -- 注意结尾是英文单引号 insert into student(name,pwd) values('李四','ab123456') insert into student(name,pwd) val 阅读全文
posted @ 2022-04-23 15:21 天井听雨 阅读(15) 评论(0) 推荐(0) 编辑
摘要:操作数据库 数据库的列类型 数据库的字段属性 create table if not exists `student`( `id`int(4) not null comment'学号', `pwd` varchar(20) default'123456' comment'密码', `naem` va 阅读全文
posted @ 2022-04-22 00:24 天井听雨 阅读(12) 评论(0) 推荐(0) 编辑
摘要:mysqld --initialize-insecure (建议使用,不设置root密码) //生成的密码在实际连接的时候可能会不小心输入错误或忘记,导致无法连接Mysql mysqld --initialize --console(不建议使用,在控制台生成一个随机的root密码) //安装mysq 阅读全文
posted @ 2022-04-21 15:58 天井听雨 阅读(45) 评论(0) 推荐(0) 编辑