全面解析MySQL(2)——CRUD基础

1.Create

Create(创建):添加新数据到数据库中

#基础语法
insert into table_name (column1,column2,column3, ...) 
values (value1,value2,value3, ...);

1.1 单行全列插入

value中值的数量和顺序必须和column⼀致

describe demo1;
+-------+-------------+------+-----+---------+-------+
| Field | Type        | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+-------+
| id    | int         | YES  |     | NULL    |       |
| name  | varchar(20) | YES  |     | NULL    |       |
| age   | int         | YES  |     | NULL    |       |
+-------+-------------+------+-----+---------+-------+
3 rows in set (0.00 sec)
#插入(id=1,name='张三',age=10)的记录
mysql> insert into demo1 values (1,'张三',10);
Query OK, 1 row affected (0.01 sec)
#插入结果如下
mysql> select * from demo1;
+------+------+------+
| id   | name | age  |
+------+------+------+
|    1 | 张三 |   10 |
+------+------+------+
1 row in set (0.00 sec)

1.2 单行指定列插入

demo1:指定(id,name,age)三列插入,相当于全列插入

insert into demo1 (id,name,age) values (2,'李四',11);
Query OK, 1 row affected (0.00 sec)mysql> select * from demo1;
+------+------+------+
| id   | name | age  |
+------+------+------+
|    1 | 张三 |   10 |
|    2 | 李四 |   11 |
+------+------+------+
2 rows in set (0.00 sec)

demo2:指定(id,name)两列插入

insert into demo1 (id,name) values (3,'王五');
Query OK, 1 row affected (0.00 sec)mysql> select * from demo1;
+------+------+------+
| id   | name | age  |
+------+------+------+
|    1 | 张三 |   10 |
|    2 | 李四 |   11 |
|    3 | 王五 | NULL |
+------+------+------+
3 rows in set (0.00 sec)

1.3 多行插入

在⼀条insert语句中也可以一次插入多行数据

insert into demo1 values (4,'赵六',12),(5,'田七',13);
Query OK, 2 rows affected (0.01 sec)
Records: 2  Duplicates: 0  Warnings: 0mysql> select * from demo1;
+------+------+------+
| id   | name | age  |
+------+------+------+
|    1 | 张三 |   10 |
|    2 | 李四 |   11 |
|    3 | 王五 | NULL |
|    4 | 赵六 |   12 |
|    5 | 田七 |   13 |
+------+------+------+
5 rows in set (0.00 sec)

2.Read

Read(读取):查询或获取现有数据

#基础语法
select 通配符/列名 from 表名

2.1 全列查询

#(*)通配符
#使⽤(*)可以查询表中(所有列)的值
select * from demo1;
+------+------+------+
| id   | name | age  |
+------+------+------+
|    1 | 张三 |   10 |
|    2 | 李四 |   11 |
|    3 | 王五 | NULL |
|    4 | 赵六 |   12 |
|    5 | 田七 |   13 |
+------+------+------+
5 rows in set (0.00 sec)

2.1 指定列查询

指定(id,name)两列查询

select id,name from demo1;
+------+------+
| id   | name |
+------+------+
|    1 | 张三 |
|    2 | 李四 |
|    3 | 王五 |
|    4 | 赵六 |
|    5 | 田七 |
+------+------+
5 rows in set (0.00 sec)
#注意1:可以指定多列查询,也可以指定单列查询
#注意2:查询的顺序和指定的顺序有关
select name,id from demo1;
+------+------+
| name | id   |
+------+------+
| 张三 |    1 |
| 李四 |    2 |
| 王五 |    3 |
| 赵六 |    4 |
| 田七 |    5 |
+------+------+
5 rows in set (0.00 sec)

2.3 表达式作为查询条件

select * from exam;
+------+--------+---------+------+---------+
| id   | name   | chinese | math | english |
+------+--------+---------+------+---------+
|    1 | 唐三藏 |      67 |   98 |      56 |
|    2 | 孙悟空 |      87 |   78 |      77 |
|    3 | 猪悟能 |      88 |   98 |      90 |
|    4 | 曹孟德 |      82 |   84 |      67 |
|    5 | 刘玄德 |      55 |   85 |      45 |
|    6 | 孙权   |      70 |   73 |      78 |
|    7 | 宋公明 |      75 |   65 |      30 |
+------+--------+---------+------+---------+
7 rows in set (0.00 sec)
#将表达式(english + 10)作为查询条件
mysql> select id,name,chinese,math,(english+10) from exam;
+------+--------+---------+------+--------------+
| id   | name   | chinese | math | (english+10) |
+------+--------+---------+------+--------------+
|    1 | 唐三藏 |      67 |   98 |           66 |
|    2 | 孙悟空 |      87 |   78 |           87 |
|    3 | 猪悟能 |      88 |   98 |          100 |
|    4 | 曹孟德 |      82 |   84 |           77 |
|    5 | 刘玄德 |      55 |   85 |           55 |
|    6 | 孙权   |      70 |   73 |           88 |
|    7 | 宋公明 |      75 |   65 |           40 |
+------+--------+---------+------+--------------+
7 rows in set (0.00 sec)

2.4 为查询结果指定别名

关键字:as

#为(chinese+math+english)指定别名为(总分)
select id,name,(chinese+math+english) as '总分' from exam;
+------+--------+------+
| id   | name   | 总分 |
+------+--------+------+
|    1 | 唐三藏 |  221 |
|    2 | 孙悟空 |  242 |
|    3 | 猪悟能 |  276 |
|    4 | 曹孟德 |  233 |
|    5 | 刘玄德 |  185 |
|    6 | 孙权   |  221 |
|    7 | 宋公明 |  170 |
+------+--------+------+
7 rows in set (0.00 sec)

2.5 去重查询

关键字:distinct

2.5.1 去重查询(单列)

select * from exam;
+------+--------+---------+------+---------+
| id   | name   | chinese | math | english |
+------+--------+---------+------+---------+
|    1 | 唐三藏 |      67 |   98 |      56 |
|    2 | 孙悟空 |      87 |   78 |      77 |
|    3 | 猪悟能 |      88 |   98 |      90 |
|    4 | 曹孟德 |      82 |   84 |      67 |
|    5 | 刘玄德 |      55 |   85 |      45 |
|    6 | 孙权   |      70 |   73 |      78 |
|    7 | 宋公明 |      75 |   65 |      30 |
|    8 | 关云长 |      70 |   80 |      90 |
+------+--------+---------+------+---------+
8 rows in set (0.00 sec)mysql> select english from exam;
+---------+
| english |
+---------+
|      56 |
|      77 |
|      90 |#第一个90分
|      67 |
|      45 |
|      78 |
|      30 |
|      90 |#第二个90分
+---------+
8 rows in set (0.00 sec)
#对(english)这一列进行去重
mysql> select distinct english from exam;
+---------+
| english |
+---------+
|      56 |
|      77 |
|      90 |#第一个90分
|      67 |
|      45 |
|      78 |
|      30 |
+---------+
7 rows in set (0.00 sec)

注意:在这里插入图片描述

2.5.2 去重查询(多列)

select * from exam;
+------+--------+---------+------+---------+
| id   | name   | chinese | math | english |
+------+--------+---------+------+---------+
|    1 | 唐三藏 |      67 |   98 |      56 |
|    2 | 孙悟空 |      87 |   78 |      77 |
|    3 | 猪悟能 |      88 |   98 |      90 |
|    4 | 曹孟德 |      82 |   84 |      67 |
|    5 | 刘玄德 |      55 |   85 |      45 |
|    6 | 孙权   |      70 |   73 |      78 |
|    7 | 宋公明 |      75 |   65 |      30 |
|    8 | 关云长 |      70 |   80 |      90 |
|    8 | 张翼德 |      70 |   80 |      90 |
+------+--------+---------+------+---------+
9 rows in set (0.00 sec)mysql> select math,english from exam;
+------+---------+
| math | english |
+------+---------+
|   98 |      56 |
|   78 |      77 |
|   98 |      90 |
|   84 |      67 |
|   85 |      45 |
|   73 |      78 |
|   65 |      30 |
|   80 |      90 |#(1)math=80,english=90
|   80 |      90 |#(2)math=80,english=90
+------+---------+
9 rows in set (0.00 sec)
#同时对(math,english)两列同时进行去重查询
#要保证两行中math和english的分数要分别相同
mysql> select distinct math,english from exam;
+------+---------+
| math | english |
+------+---------+
|   98 |      56 |
|   78 |      77 |
|   98 |      90 |
|   84 |      67 |
|   85 |      45 |
|   73 |      78 |
|   65 |      30 |
|   80 |      90 |
+------+---------+
8 rows in set (0.00 sec)

注意:
在这里插入图片描述

2.6 条件查询

关键字:where

#基础语法
select 通配符/列名 from 表名 where (条件)

2.6.1 比较运算符

运算符说明
>,<,>=,<=大于,小于,大于等于,小于等于
=等于(MySQL中不存在==)
<=>用于null的比较。例如:null <=> null 的结果是true,null = null 的结果还是null
!=,<>不等于
value between A and B范围匹配,如果value在[A,B]之间返回true
value not between A and B范围匹配,如果(value < A并且 value > B)返回true
value in (option1,option2…)如果value与某一option匹配则返回true,not in表示取反
is null/is not null是null/不是null
_模糊匹配,表示(一个)任意字符
like模糊匹配,表示(任意个)任意字符

2.6.2 逻辑运算符

运算符说明
and逻辑与,全true为true,有false为false
or逻辑或,全false为false,有true为true
not逻辑非,条件为true,结果为false

2.6.3 比较条件查询

demo1:查询语文成绩比数学高的记录

select * from exam where chinese > math;
+------+--------+---------+------+---------+
| id   | name   | chinese | math | english |
+------+--------+---------+------+---------+
|    2 | 孙悟空 |      87 |   78 |      77 |
|    7 | 宋公明 |      75 |   65 |      30 |
+------+--------+---------+------+---------+
2 rows in set (0.01 sec)

demo2:查询英语大于60的记录

select * from exam where english > 60;
+------+--------+---------+------+---------+
| id   | name   | chinese | math | english |
+------+--------+---------+------+---------+
|    2 | 孙悟空 |      87 |   78 |      77 |
|    3 | 猪悟能 |      88 |   98 |      90 |
|    4 | 曹孟德 |      82 |   84 |      67 |
|    6 | 孙权   |      70 |   73 |      78 |
|    8 | 关云长 |      70 |   80 |      90 |
|    8 | 张翼德 |      70 |   80 |      90 |
+------+--------+---------+------+---------+
6 rows in set (0.00 sec)

demo3:查询总分大于200的记录

select id,name,(chinese + math + english) as '总分' from exam where (chinese + math + english) > 200;
+------+--------+------+
| id   | name   | 总分 |
+------+--------+------+
|    1 | 唐三藏 |  221 |
|    2 | 孙悟空 |  242 |
|    3 | 猪悟能 |  276 |
|    4 | 曹孟德 |  233 |
|    6 | 孙权   |  221 |
|    8 | 关云长 |  240 |
|    8 | 张翼德 |  240 |
+------+--------+------+
7 rows in set (0.00 sec)

注意:不能在where条件中进行取别名的操作在这里插入图片描述

2.6.4 逻辑条件查询

demo1:查询语文成绩大于80分并且数学成绩大于80分的同学

select * from exam where chinese > 80 and math > 80;
+------+--------+---------+------+---------+
| id   | name   | chinese | math | english |
+------+--------+---------+------+---------+
|    3 | 猪悟能 |      88 |   98 |      90 |
|    4 | 曹孟德 |      82 |   84 |      67 |
+------+--------+---------+------+---------+
2 rows in set (0.00 sec)

demo2:查询语文成绩大于80或者数学成绩大于80分的同学

select * from exam where chinese > 80 or math > 80;
+------+--------+---------+------+---------+
| id   | name   | chinese | math | english |
+------+--------+---------+------+---------+
|    1 | 唐三藏 |      67 |   98 |      56 |
|    2 | 孙悟空 |      87 |   78 |      77 |
|    3 | 猪悟能 |      88 |   98 |      90 |
|    4 | 曹孟德 |      82 |   84 |      67 |
|    5 | 刘玄德 |      55 |   85 |      45 |
+------+--------+---------+------+---------+
5 rows in set (0.00 sec)

注意:and的优先级大于or在这里插入图片描述

2.6.5 范围查询

demo1:查询语文成绩在[80,90]分的记录

select * from exam where chinese between 80 and 90;
+------+--------+---------+------+---------+
| id   | name   | chinese | math | english |
+------+--------+---------+------+---------+
|    2 | 孙悟空 |      87 |   78 |      77 |
|    3 | 猪悟能 |      88 |   98 |      90 |
|    4 | 曹孟德 |      82 |   84 |      67 |
+------+--------+---------+------+---------+
3 rows in set (0.00 sec)

demo2:查询数学成绩是78或者79或者98或者99分的记录

#使用or实现
select * from exam where math = 78 or math = 79 or math = 98 or math = 99;
+------+--------+---------+------+---------+
| id   | name   | chinese | math | english |
+------+--------+---------+------+---------+
|    1 | 唐三藏 |      67 |   98 |      56 |
|    2 | 孙悟空 |      87 |   78 |      77 |
|    3 | 猪悟能 |      88 |   98 |      90 |
+------+--------+---------+------+---------+
3 rows in set (0.00 sec)
#使用in实现
mysql> select * from exam where math in (78,79,98,99);
+------+--------+---------+------+---------+
| id   | name   | chinese | math | english |
+------+--------+---------+------+---------+
|    1 | 唐三藏 |      67 |   98 |      56 |
|    2 | 孙悟空 |      87 |   78 |      77 |
|    3 | 猪悟能 |      88 |   98 |      90 |
+------+--------+---------+------+---------+
3 rows in set (0.00 sec)

2.6.6 模糊查询

demo1:查询姓孙的记录

select * from exam where name like '孙%';
+------+--------+---------+------+---------+
| id   | name   | chinese | math | english |
+------+--------+---------+------+---------+
|    2 | 孙悟空 |      87 |   78 |      77 |
|    6 | 孙权   |      70 |   73 |      78 |
+------+--------+---------+------+---------+
2 rows in set (0.00 sec)

demo2:查询姓孙并且名字只有两个字的记录

select * from exam where name like '孙_';
+------+------+---------+------+---------+
| id   | name | chinese | math | english |
+------+------+---------+------+---------+
|    6 | 孙权 |      70 |   73 |      78 |
+------+------+---------+------+---------+
1 row in set (0.00 sec)

2.6.7 null(空)值查询

demo1:查询英语成绩为null的记录

select * from exam where english is null;
+------+--------+---------+------+---------+
| id   | name   | chinese | math | english |
+------+--------+---------+------+---------+
|   11 | 黄汉升 |      70 |   85 |    NULL |
+------+--------+---------+------+---------+
1 row in set (0.00 sec)mysql> select * from exam where english <=> null;
+------+--------+---------+------+---------+
| id   | name   | chinese | math | english |
+------+--------+---------+------+---------+
|   11 | 黄汉升 |      70 |   85 |    NULL |
+------+--------+---------+------+---------+
1 row in set (0.00 sec)

demo2:查询英语成绩不为null的记录

select * from exam where english != null;
Empty set (0.00 sec)mysql> select * from exam where english <> null;
Empty set (0.00 sec)mysql> select * from exam where english is not null;
+------+--------+---------+------+---------+
| id   | name   | chinese | math | english |
+------+--------+---------+------+---------+
|    1 | 唐三藏 |      67 |   98 |      56 |
|    2 | 孙悟空 |      87 |   78 |      77 |
|    3 | 猪悟能 |      88 |   98 |      90 |
|    4 | 曹孟德 |      82 |   84 |      67 |
|    5 | 刘玄德 |      55 |   85 |      45 |
|    6 | 孙权   |      70 |   73 |      78 |
|    7 | 宋公明 |      75 |   65 |      30 |
|    8 | 关云长 |      70 |   80 |      90 |
|    8 | 张翼德 |      70 |   80 |      90 |
|   10 | 赵子龙 |      70 |   85 |      85 |
+------+--------+---------+------+---------+
10 rows in set (0.00 sec)

2.7 排序

  • asc:升序
  • desc:降序,不是查看表结构的desc(describe)
#基础语法
#默认asc
select 通配符/列名 from 表名 (where...) order by 列名 (asc/desc);

demo1:按照语文成绩升序

select * from exam order by chinese asc;
+------+--------+---------+------+---------+
| id   | name   | chinese | math | english |
+------+--------+---------+------+---------+
|    5 | 刘玄德 |      55 |   85 |      45 |
|    1 | 唐三藏 |      67 |   98 |      56 |
|    6 | 孙权   |      70 |   73 |      78 |
|    8 | 关云长 |      70 |   80 |      90 |
|    8 | 张翼德 |      70 |   80 |      90 |
|   10 | 赵子龙 |      70 |   85 |      85 |
|   11 | 黄汉升 |      70 |   85 |    NULL |
|    7 | 宋公明 |      75 |   65 |      30 |
|    4 | 曹孟德 |      82 |   84 |      67 |
|    2 | 孙悟空 |      87 |   78 |      77 |
|    3 | 猪悟能 |      88 |   98 |      90 |
+------+--------+---------+------+---------+
11 rows in set (0.00 sec)

demo2:按照语文成绩降序

select * from exam order by chinese desc;
+------+--------+---------+------+---------+
| id   | name   | chinese | math | english |
+------+--------+---------+------+---------+
|    3 | 猪悟能 |      88 |   98 |      90 |
|    2 | 孙悟空 |      87 |   78 |      77 |
|    4 | 曹孟德 |      82 |   84 |      67 |
|    7 | 宋公明 |      75 |   65 |      30 |
|    6 | 孙权   |      70 |   73 |      78 |
|    8 | 关云长 |      70 |   80 |      90 |
|    8 | 张翼德 |      70 |   80 |      90 |
|   10 | 赵子龙 |      70 |   85 |      85 |
|   11 | 黄汉升 |      70 |   85 |    NULL |
|    1 | 唐三藏 |      67 |   98 |      56 |
|    5 | 刘玄德 |      55 |   85 |      45 |
+------+--------+---------+------+---------+
11 rows in set (0.00 sec)

demo3:按照数学降序,英语升序,语⽂升序

select * from exam order by math desc,english asc,chinese asc;
+------+--------+---------+------+---------+
| id   | name   | chinese | math | english |
+------+--------+---------+------+---------+
|    1 | 唐三藏 |      67 |   98 |      56 |
|    3 | 猪悟能 |      88 |   98 |      90 |
|   11 | 黄汉升 |      70 |   85 |    NULL |
|    5 | 刘玄德 |      55 |   85 |      45 |
|   10 | 赵子龙 |      70 |   85 |      85 |
|    4 | 曹孟德 |      82 |   84 |      67 |
|    8 | 关云长 |      70 |   80 |      90 |
|    8 | 张翼德 |      70 |   80 |      90 |
|    2 | 孙悟空 |      87 |   78 |      77 |
|    6 | 孙权   |      70 |   73 |      78 |
|    7 | 宋公明 |      75 |   65 |      30 |
+------+--------+---------+------+---------+
11 rows in set (0.00 sec)

2.8 分页查询

#基础语法1:默认从0开始,筛选num条记录
select 通配符/列名 from 表名 (where...) (order by ...) limit num;
#基础语法2:从start开始,筛选num条记录
select 通配符/列名 from 表名 (where...) (order by ...) limit start,num;
#基础语法3(建议):从start开始,筛选num条记录
select 通配符/列名 from 表名 (where...) (order by ...) limit num offset start;

demo1:假设一页有三条记录,查询第一页的记录

#建议搭配(order by)使用
select * from exam order by id asc limit 3 offset 0;
+------+--------+---------+------+---------+
| id   | name   | chinese | math | english |
+------+--------+---------+------+---------+
|    1 | 唐三藏 |      67 |   98 |      56 |
|    2 | 孙悟空 |      87 |   78 |      77 |
|    3 | 猪悟能 |      88 |   98 |      90 |
+------+--------+---------+------+---------+
3 rows in set (0.00 sec)

demo2:假设一页有三条记录,查询第二页的记录

select * from exam order by id asc limit 3 offset 3;
+------+--------+---------+------+---------+
| id   | name   | chinese | math | english |
+------+--------+---------+------+---------+
|    4 | 曹孟德 |      82 |   84 |      67 |
|    5 | 刘玄德 |      55 |   85 |      45 |
|    6 | 孙权   |      70 |   73 |      78 |
+------+--------+---------+------+---------+
3 rows in set (0.00 sec)

3.Update

Update(更新):修改数据库或系统中已存在的记录

#基础语法
update 表名 (要修改的数据) (where...) (order by...) (limit...);

demo1:将孙悟空的数学成绩变更为80分

update exam set math = 80 where name = '孙悟空';
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0mysql> select * from exam where name = '孙悟空';
+------+--------+---------+------+---------+
| id   | name   | chinese | math | english |
+------+--------+---------+------+---------+
|    2 | 孙悟空 |      87 |   80 |      77 |
+------+--------+---------+------+---------+
1 row in set (0.00 sec)

demo2:将曹孟德的数学成绩变更为60分,语文成绩变更为70

update exam set math = 60,chinese = 70 where name = '曹孟德';
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0mysql> select * from exam where name = '曹孟德';
+------+--------+---------+------+---------+
| id   | name   | chinese | math | english |
+------+--------+---------+------+---------+
|    4 | 曹孟德 |      70 |   60 |      67 |
+------+--------+---------+------+---------+
1 row in set (0.00 sec)

注意:当update语句缺少where条件时,全表的记录都将被更新

4.Delete

Delete(删除):从数据库或系统中移除记录

#基础语法
delete from 表名 (where...) (order by...) (limit...);

demo1:删除姓名为黄汉升的记录

delete from exam where name = '黄汉升';
Query OK, 1 row affected (0.01 sec)mysql> select * from exam;
+------+--------+---------+------+---------+
| id   | name   | chinese | math | english |
+------+--------+---------+------+---------+
|    1 | 唐三藏 |      67 |   98 |      56 |
|    2 | 孙悟空 |      87 |   80 |      77 |
|    3 | 猪悟能 |      88 |   98 |      90 |
|    4 | 曹孟德 |      70 |   60 |      67 |
|    5 | 刘玄德 |      55 |   85 |      45 |
|    6 | 孙权   |      70 |   73 |      78 |
|    7 | 宋公明 |      75 |   65 |      30 |
|    8 | 关云长 |      70 |   80 |      90 |
|    8 | 张翼德 |      70 |   80 |      90 |
|   10 | 赵子龙 |      70 |   85 |      85 |
+------+--------+---------+------+---------+
10 rows in set (0.00 sec)

demo2:删除整张表的记录

delete from exam;
Query OK, 10 rows affected (0.01 sec)mysql> select * from exam;
Empty set (0.00 sec)

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:http://www.pswp.cn/bicheng/89848.shtml
繁体地址,请注明出处:http://hk.pswp.cn/bicheng/89848.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

某外企笔试总结——纯C语言

这里写自定义目录标题一、sizeof 计算&#xff08;32位环境&#xff09;二、简答题三、数据存储区域与可修改性四、字符串比较输出及原因五、数组指针运算输出六、字符串倒序代码错误排查七、下面程序可以把1维数组转为2维数组&#xff0c;然后调用 printArr2D 打印出数组内容&…

Qt Graphs 模块拟取代 charts 和 data visualization还有很长的路要走

近期关注 Qt 6.10 的分支进展&#xff0c; 发现了 Qt 6.10 的 charts 和 data visualization &#xff08;以下简称 DV&#xff09;已经被deprecated, 功能将会合并到 graphs 模块。如果后面 charts\ DV 被弃用&#xff0c;那算是很大的API变化了。从Qt 6.5 以后开始引入的 gra…

2025牛客暑期多校训练营2(部分补题)

题目链接&#xff1a;牛客竞赛_ACM/NOI/CSP/CCPC/ICPC算法编程高难度练习赛_牛客竞赛OJ B Bitwise Perfect 思路 考虑到由&#xff0c;那么只有变小的时候对答案的贡献才能够减少&#xff0c;从二进制的角度考虑什么时候变小&#xff0c;只有min(x,y)中的最高位1异或之后变…

Nginx的location匹配规则

Nginx的location匹配规则 为什么你的Nginx配置总是不生效&#xff1f; 改了Nginx配置无数次&#xff0c;reload命令执行了几十遍&#xff0c;浏览器访问时却依然返回404&#xff1f;运维工程师小张上周就遇到了这个问题&#xff1a;明明配置了location /static/ { root /var/ww…

USB 2.0 vs USB 3.0:全面技术对比与选择指南

USB 2.0 vs USB 3.0&#xff1a;全面技术对比与选择指南 引言 在当今数字时代&#xff0c;USB接口已成为连接设备与计算机的最普遍标准之一。从2000年USB 2.0的发布到2008年USB 3.0的问世&#xff0c;USB技术经历了显著的演进。本文将深入比较这两种广泛使用的USB标准&#xff…

DApp架构设计与开发流程指南

目录 DApp架构设计与开发流程指南 引言:DApp的核心特性 一、DApp架构设计 1.1 分层架构设计 各层核心组件: 1.2 典型架构模式 1.2.1 全去中心化架构 1.2.2 混合架构(推荐) 二、开发流程 2.1 敏捷开发流程 2.2 详细开发阶段 阶段1:需求分析与设计(1-2周) 阶段2:智能合约…

Windows下odbc配置连接SQL Server

一、查看SQL Server服务是否启动打开SQL Server 2022配置管理器查看SQL Server运行状态&#xff0c;可以设置 启动或停止服务二、windows下如何配置ODBC数据源1、Windows搜索栏中输入“ODBC数据源管理器”并选择“以管理员身份运行”来打开它2、添加新的数据源ODBC数据源管理器…

MySQL—表设计和聚合函数以及正则表达式

文章目录一、第一范式&#xff08;原子性&#xff09;二、第二范式&#xff08;消除部分依赖&#xff09;三、第三范式&#xff08;消除传递依赖&#xff09;四、表设计五、聚合函数六、正则表达式MySQL 的三大范式&#xff08;1NF、2NF、3NF&#xff09;是关系型数据库设计的核…

基于Electron打包jar成Windows应用程序

基于Electron打包jar成Windows应用程序简介注意编译及命令&#xff1a;运行效果登录界面用户管理界面界面全屏锁屏界面文档查看界面简介 本文介绍了一种将maven jar包打包成Windows下EXE可执行程序的方法。 Maven打包Java Web应用成jar&#xff0c;Electron封装jar成Windows …

Autosar RTE实现观测量生成-基于ETAS软件

文章目录前言观测量定义arTypedPerInstanceMemoryPorts Measurable工具链配置及使用Port中的配置arTypedPerInstanceMemory观测量生成文件分析总结前言 之前我们在XCP中&#xff0c;对于标定量和观测量并没有严格按照Autosar标准中定义&#xff0c;Autosar RTE中对标定量和观测…

【REACT18.x】creat-react-app在添加eslint时报错Environment key “jest/globals“ is unknown

今天在创建新项目的时候&#xff0c;给cra创建的项目添加eslint支持&#xff0c;出现如下报错 添加eslint npx eslint --init页面报错 Compiled with problems:ERROR [eslint] package.json eslint-config-react-app/jest#overrides[0]:Environment key "jest/globals&…

Linux的例行性工作 -- (练习)

1、atd和crond两个任务管理程序的区别 答&#xff1a; atd 专为一次性任务设计&#xff0c;允许用户在特定未来时间点&#xff08;绝对或相对时间&#xff09;执行单次命令后就结束。 crond 则是周期性任务的调度核心&#xff0c;通过配置文件&#xff08;crontab&#xff09;实…

《Java语言程序设计》1.6 复习题

1.6.1 什么是Java语言规范?计算机有严格的使用规则。如果编写程序时没有遵循这些规则&#xff0c;计算机就不能理解程序。Java语言规范和Java API定义了Java的标准。Java语言规范(Java language specification)是对Java程序设计语言的语法和语义的技术定义。应用程序接口(Appl…

【机器学习深度学习】什么是量化?

目录 前言 一、量化的基本概念 1.1 量化对比示例 1.2 量化是如何实现的&#xff1f; 二、为什么要进行量化&#xff1f; 2.1 解决模型体积过大问题 2.2 降低对算力的依赖 2.3 加速模型训练和推理 2.4 优化训练过程 2.5 降低部署成本 小结&#xff1a;量化的应用场…

告别 T+1!解密金融级实时数据平台的构建与实践

在数字金融浪潮下&#xff0c;数据处理的“实时性”已不再是加分项&#xff0c;而是逐渐成为决定业务价值的核心竞争力。然而&#xff0c;金融机构在追求实时的道路上&#xff0c;往往陷入一个新的困境&#xff1a;实时分析系统与离线大数据平台形成了两套独立的“烟囱”&#…

[Python] -项目实战7- 用Python和Tkinter做一个图形界面小游戏

一、为什么从小游戏入门GUI? 趣味性强:小游戏直观、有趣,一学就上手。 系统掌握事件驱动:了解按钮点击、键盘响应、图形刷新机制。 扎实基础:为日后构建更复杂应用奠定 GUI 编程基础。 二、选定游戏:猜数字小游戏 🎯 这个小游戏界面简单,核心机制是:3 个按钮分别…

【18】MFC入门到精通——MFC(VS2019)+ OpenCV 显示图片的3种方法

MFC (VS2019)+ OpenCV,显示图片的3种方法 1 方法介绍 2 方法一:嵌套OpenCV窗口显示图片 2.1 建立供工程 添加控件 2.2 引用头文件 2.3 找到OnInitDialog()函数,在其中添加如下代码 2.4 在button触发函数中加入代码(就是你双击button进入的函数) 2.5 注意事项 3 方法二:…

以“融合进化 智领未来”之名,金仓Kingbase FlySync:国产数据库技术的突破与创新

目录开篇&#xff1a;国产数据库的历史性跨越一、KFS 产品定位及发展历程回顾1.1 Kingbase FlySync 发展1.2 Kingbase FlySync与Oracle GoldenGate的对比分析1.2.1 Kingbase FlySync 功能优势1.2.2 技术架构对比1.2.3 性能与扩展性二、数字化时代的新挑战2.1 决策实时性要求越来…

服务器配置错误漏洞

文章目录一、文件解析漏洞1.Apache HTTPD多后缀解析漏洞二、目录遍历漏洞1.Apache目录遍历漏洞2.Nginx目录穿越漏洞服务器配置错误漏洞指因服务器&#xff08;含系统、Web服务、数据库等&#xff09;的参数设置、权限分配、组件配置等不当&#xff0c;导致的安全问题&#xff0…

大模型预测输尿管上段结石技术方案大纲

目录 1. 术前阶段 2. 术中阶段 3. 术后阶段 4. 并发症风险预测 5. 根据预测定手术方案 6. 麻醉方案 7. 术后护理 8. 统计分析 9. 技术验证方法 10. 实验证据 11. 健康教育与指导 12. 完整术方案流程图(Mermaid) 1. 术前阶段 步骤 关键要素 可编辑字段 1.1 影像采集 CT-IVU / …