MySQL-数据库设计与实现

目录

第1关:从概念模型到MySQL实现

第2关:从需求分析到逻辑模型

第3关:建模工具的使用


第1关:从概念模型到MySQL实现

任务描述

将已建好的概念模型,变成MySQL物理实现。

 # 请将你实现flight_booking数据库的语句写在下方:# 请将你实现flight_booking数据库的语句写在下方:drop database if exists flight_booking; 
create database flight_booking; 
use flight_booking;SET NAMES utf8mb4; 
SET FOREIGN_KEY_CHECKS = 0;DROP TABLE IF EXISTS airline ; CREATE TABLE airline ( airline_id int NOT NULL AUTO_INCREMENT, name varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, iata char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, airport_id int NOT NULL, PRIMARY KEY ( airline_id ) USING BTREE, UNIQUE INDEX iata_unq ( iata ) USING BTREE, INDEX base_airport_idx ( airport_id ) USING BTREE, CONSTRAINT airline_ibfk_1 FOREIGN KEY ( airport_id ) REFERENCES airport ( airport_id ) ON DELETE RESTRICT ON UPDATE RESTRICT ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;DROP TABLE IF EXISTS airplane ; CREATE TABLE airplane ( airplane_id int(0) NOT NULL AUTO_INCREMENT, type varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, capacity smallint(0) NOT NULL, identifier varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, airline_id int(0) NOT NULL,
PRIMARY KEY ( airplane_id ) USING BTREE, INDEX airplane_ibfk_1 ( airline_id ) USING BTREE, CONSTRAINT airplane_ibfk_1 FOREIGN KEY ( airline_id ) REFERENCES airline ( airline_id ) ON DELETE RESTRICT ON UPDATE RESTRICT ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;DROP TABLE IF EXISTS airport ; CREATE TABLE airport ( airport_id int NOT NULL AUTO_INCREMENT, iata char(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, icao char(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, name varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, city varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL, country varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL, latitude decimal(11, 8) NULL DEFAULT NULL, longitude decimal(11, 8) NULL DEFAULT NULL, PRIMARY KEY ( airport_id ) USING BTREE, UNIQUE INDEX iata_unq ( iata ) USING BTREE, UNIQUE INDEX icao_unq ( icao ) USING BTREE, INDEX name_idx ( name ) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;DROP TABLE IF EXISTS passenger ; CREATE TABLE passenger ( passenger_id int NOT NULL AUTO_INCREMENT, id char(18) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, firstname varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, lastname varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, mail varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL, phone varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, sex char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, dob date NULL DEFAULT NULL, PRIMARY KEY ( passenger_id ) USING BTREE, UNIQUE INDEX id_unq ( id ) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;DROP TABLE IF EXISTS ticket ; CREATE TABLE ticket ( ticket_id int NOT NULL AUTO_INCREMENT, flight_id int NOT NULL, seat char(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL, passenger_id int NOT NULL, price decimal(10, 2) NOT NULL, user_id int NOT NULL, PRIMARY KEY ( ticket_id ) USING BTREE, INDEX flight_idx ( flight_id ) USING BTREE, INDEX passenger_idx ( passenger_id ) USING BTREE, INDEX ticket_ibfk_3 ( user_id ) USING BTREE, CONSTRAINT ticket_ibfk_1 FOREIGN KEY ( flight_id ) REFERENCES flight ( flight_id ) ON DELETE RESTRICT ON UPDATE RESTRICT, CONSTRAINT ticket_ibfk_2 FOREIGN KEY ( passenger_id ) REFERENCES passenger ( passenger_id ) ON DELETE RESTRICT ON UPDATE RESTRICT, CONSTRAINT ticket_ibfk_3 FOREIGN KEY ( user_id ) REFERENCES user ( user_id ) ON DELETE RESTRICT ON UPDATE RESTRICT ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;DROP TABLE IF EXISTS user ; CREATE TABLE user ( user_id int NOT NULL AUTO_INCREMENT, firstname varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, lastname varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, dob date NOT NULL, sex char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, email varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
phone varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL, username varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, password char(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, admin_tag tinyint NOT NULL DEFAULT 0, PRIMARY KEY ( user_id ) USING BTREE, UNIQUE INDEX user_unq ( username ) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; SET FOREIGN_KEY_CHECKS = 1;DROP TABLE IF EXISTS flightschedule ; CREATE TABLE flightschedule ( flight_no char(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `from` int NOT NULL, `to` int NOT NULL, departure time NOT NULL, arrival time NOT NULL, duration smallint NOT NULL,
airline_id int NOT NULL, monday tinyint NULL DEFAULT 0, 
tuesday tinyint NULL DEFAULT 0, 
wednesday tinyint NULL DEFAULT 0, 
thursday tinyint NULL DEFAULT 0, friday tinyint NULL DEFAULT 0, saturday tinyint NULL DEFAULT 0, sunday tinyint NULL DEFAULT 0, 
PRIMARY KEY ( flight_no ) USING BTREE, 
INDEX from_idx ( `from` ) USING BTREE, 
INDEX to_idx ( `to` ) USING BTREE, 
INDEX airline_idx ( airline_id ) USING BTREE, 
CONSTRAINT flightschedule_ibfk_1 FOREIGN KEY ( `from` ) REFERENCES airport ( airport_id ) ON DELETE RESTRICT ON UPDATE RESTRICT, CONSTRAINT flightschedule_ibfk_2 FOREIGN KEY ( `to` ) REFERENCES airport ( airport_id ) ON DELETE RESTRICT ON UPDATE RESTRICT, CONSTRAINT flightschedule_ibfk_3 FOREIGN KEY ( airline_id ) REFERENCES airline ( airline_id ) ON DELETE RESTRICT ON UPDATE RESTRICT ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;DROP TABLE IF EXISTS flight ; CREATE TABLE flight ( flight_id int NOT NULL AUTO_INCREMENT, flight_no char(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `from` int NOT NULL, `to` int NOT NULL,
departure datetime NOT NULL, arrival datetime NOT NULL, duration smallint NOT NULL, airline_id int NOT NULL, airplane_id int NOT NULL, 
PRIMARY KEY ( flight_id ) USING BTREE, 
INDEX from_idx ( `from` ) USING BTREE, 
INDEX to_idx ( `to` ) USING BTREE, 
-- INDEX departure_idx ( departure ) USING BTREE, 
-- INDEX arrivals_idx ( arrival ) USING BTREE, 
INDEX airline_idx ( airline_id ) USING BTREE, 
INDEX airplane_idx ( airplane_id ) USING BTREE, 
INDEX flightno ( flight_no ) USING BTREE, 
CONSTRAINT flight_ibfk_1 FOREIGN KEY ( `from` ) REFERENCES airport ( airport_id ) ON DELETE RESTRICT ON UPDATE RESTRICT, CONSTRAINT flight_ibfk_2 FOREIGN KEY ( `to` ) REFERENCES airport ( airport_id ) ON DELETE RESTRICT ON UPDATE RESTRICT, CONSTRAINT flight_ibfk_3 FOREIGN KEY ( airline_id ) REFERENCES airline ( airline_id ) ON DELETE RESTRICT ON UPDATE RESTRICT, CONSTRAINT flight_ibfk_4 FOREIGN KEY ( airplane_id ) REFERENCES airplane ( airplane_id ) ON DELETE RESTRICT ON UPDATE RESTRICT, CONSTRAINT flight_ibfk_5 FOREIGN KEY ( flight_no ) REFERENCES flightschedule ( flight_no ) ON DELETE RESTRICT ON UPDATE RESTRICT ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;SET FOREIGN_KEY_CHECKS = 1;

第2关:从需求分析到逻辑模型

任务描述

本关任务: 根据应用场景业务需求描述,完成ER图,并转换成关系模式。 提交设计文档

请给出ER图文件存放的URL:
https://s1.wzznft.com/i/2023/12/01/ersolution.png以下给出关系模式:电影(movie)(movie_ID, title, type, runtime, release_date, director, starring), 主码:(movie_ID)顾客(customer)(c_ID, name, phone), 主码:(c_ID)放映厅(hall)(hall_ID, mode, capacity, location), 主码:(hall_ID)排场(schedule)(schedule_ID, date, time, price, number, hall_ID, movie_ID), 主码:(schedule_ID),外码:(hall_ID) 参照放映厅(hall),(movie_ID) 参照电影(movie)电影票(ticket)(ticket_ID, seat_num, c_ID, schedule_ID), 主码:(ticket_ID),外码:(c_ID) 参照顾客(customer),(schedule_ID) 参照排场(schedule)# 请将利用MySQL Workbench软件的Modeling工具,经forward engineering 导出的创建schema的SQL语句完整粘到此处:
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; 
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; 
SET @OLD_SQL_MODE=@@SQL_MODE, 
SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';
CREATE SCHEMA IF NOT EXISTS rbac DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci ; 
USE rbac ;
CREATE TABLE IF NOT EXISTS rbac . aprole (
RoleNo INT NOT NULL COMMENT '角色编号', 
RoleName CHAR(20) NOT NULL COMMENT '角色名', 
Comment VARCHAR(50) NULL DEFAULT NULL COMMENT '角色描述', 
Status SMALLINT NULL DEFAULT NULL COMMENT '角色状态', 
PRIMARY KEY ( RoleNo )) 
ENGINE = InnoDB 
DEFAULT CHARACTER SET = utf8mb4 
COLLATE = utf8mb4_0900_ai_ci 
COMMENT = '角色表';
CREATE TABLE IF NOT EXISTS rbac . apuser(UserID CHAR(8) NOT NULL COMMENT '用户工号',UserName CHAR(8) NULL DEFAULT NULL COMMENT '用户姓名', Comment VARCHAR(50) NULL DEFAULT NULL COMMENT '用户描述', PassWord CHAR(32) NULL DEFAULT NULL COMMENT '口令', Status SMALLINT NULL DEFAULT NULL COMMENT '状态',PRIMARY KEY ( UserID ), UNIQUE INDEX ind_username ( UserName ASC) VISIBLE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4COLLATE = utf8mb4_0900_ai_ci COMMENT = '用户表';
CREATE TABLE IF NOT EXISTS rbac . apgroup (UserID CHAR(8) NOT NULL COMMENT '用户编号', RoleNo INT NOT NULL COMMENT '角色编号', PRIMARY KEY ( UserID , RoleNo ), INDEX FK_apGroup_apRole ( RoleNo ASC) VISIBLE, CONSTRAINT FK_apGroup_apRole FOREIGN KEY ( RoleNo ) REFERENCES rbac . aprole ( RoleNo ),CONSTRAINT FK_apGroup_apUser FOREIGN KEY ( UserID ) REFERENCES rbac . apuser ( UserID ))ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '角色分配表';
CREATE TABLE IF NOT EXISTS rbac . apmodule (ModNo BIGINT NOT NULL COMMENT '模块编号', ModID CHAR(10) NULL DEFAULT NULL COMMENT '系统或模块的代码', ModName CHAR(20) NULL DEFAULT NULL COMMENT 

第3关:建模工具的使用

任务描述

本关任务: 将一个建好的模型文件,利用MySQL Workbench的forward engineering功能,自动转换成SQL脚本。

 # 请将利用MySQL Workbench软件的Modeling工具,经forward engineering 导出的创建schema的SQL语句完整粘到此处:# 请将利用MySQL Workbench软件的Modeling工具,经forward engineering 导出的创建schema的SQL语句完整粘到此处:SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; 
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; 
SET @OLD_SQL_MODE=@@SQL_MODE, 
SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';CREATE SCHEMA IF NOT EXISTS rbac DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci ; 
USE rbac ;CREATE TABLE IF NOT EXISTS rbac . aprole (
RoleNo INT NOT NULL COMMENT '角色编号', 
RoleName CHAR(20) NOT NULL COMMENT '角色名', 
Comment VARCHAR(50) NULL DEFAULT NULL COMMENT '角色描述', 
Status SMALLINT NULL DEFAULT NULL COMMENT '角色状态', 
PRIMARY KEY ( RoleNo )) 
ENGINE = InnoDB 
DEFAULT CHARACTER SET = utf8mb4 
COLLATE = utf8mb4_0900_ai_ci 
COMMENT = '角色表';CREATE TABLE IF NOT EXISTS rbac . apuser(UserID CHAR(8) NOT NULL COMMENT '用户工号',UserName CHAR(8) NULL DEFAULT NULL COMMENT '用户姓名', Comment VARCHAR(50) NULL DEFAULT NULL COMMENT '用户描述', PassWord CHAR(32) NULL DEFAULT NULL COMMENT '口令', Status SMALLINT NULL DEFAULT NULL COMMENT '状态',PRIMARY KEY ( UserID ), UNIQUE INDEX ind_username ( UserName ASC) VISIBLE) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4COLLATE = utf8mb4_0900_ai_ci COMMENT = '用户表';CREATE TABLE IF NOT EXISTS rbac . apgroup (UserID CHAR(8) NOT NULL COMMENT '用户编号', RoleNo INT NOT NULL COMMENT '角色编号', PRIMARY KEY ( UserID , RoleNo ), INDEX FK_apGroup_apRole ( RoleNo ASC) VISIBLE, CONSTRAINT FK_apGroup_apRole FOREIGN KEY ( RoleNo ) REFERENCES rbac . aprole ( RoleNo ),CONSTRAINT FK_apGroup_apUser FOREIGN KEY ( UserID ) REFERENCES rbac . apuser ( UserID ))ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '角色分配表';CREATE TABLE IF NOT EXISTS rbac . apmodule (ModNo BIGINT NOT NULL COMMENT '模块编号', ModID CHAR(10) NULL DEFAULT NULL COMMENT '系统或模块的代码', ModName CHAR(20) NULL DEFAULT NULL COMMENT '系统或模块的名称', PRIMARY KEY ( ModNo ))ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '功能模块登记表';CREATE TABLE IF NOT EXISTS rbac . apright (
RoleNo INT NOT NULL COMMENT '角色编号', 
ModNo BIGINT NOT NULL COMMENT '模块编号', 
PRIMARY KEY ( RoleNo , ModNo ), 
INDEX FK_apRight_apModule ( ModNo ASC) VISIBLE,
CONSTRAINT FK_apRight_apModule 
FOREIGN KEY ( ModNo ) 
REFERENCES rbac . apmodule ( ModNo ), 
CONSTRAINT FK_apRight_apRole
FOREIGN KEY ( RoleNo ) 
REFERENCES rbac . aprole ( RoleNo ))
ENGINE = InnoDB 
DEFAULT CHARACTER SET = utf8mb4 
COLLATE = utf8mb4_0900_ai_ci 
COMMENT = '角色权限表';SET SQL_MODE=@OLD_SQL_MODE; 
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; 
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;

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

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

相关文章

CCC数字车钥匙(八)——BLE配对相关字段

2.1 配对连接协议 2.1.3 所有者配对广播 对于所有者配对,仅支持Legacy LE 1M PHY。ADV_IND需要按照Section 2.3.1.1 Volume 6 Part B。 事件类型:无指向可连接和可扫描。 ADV_IND中包含广播地址和广播数据,如下所示,其中广播地址…

TZOJ 1402 Bitset

答案&#xff1a; #include <stdio.h> int main() {int n 0, j 0; while (scanf("%d", &n) ! EOF && (n>0 && n<1000)) //多组输入{int arr[32], i 0;while (n > 0) {arr[i] n % 2; //除2取余法n / 2;}for (j i -…

力扣题:字符的统计-12.1

力扣题-12.1 [力扣刷题攻略] Re&#xff1a;从零开始的力扣刷题生活 力扣题1&#xff1a;451. 根据字符出现频率排序 解题思想&#xff1a;统计字符出现的个数&#xff0c;进行排序即可 class Solution(object):def frequencySort(self, s):""":type s: str:…

【C/PTA】指针专项练习(二)

本文结合PTA专项练习带领读者掌握指针&#xff0c;刷题为主注释为辅&#xff0c;在代码中理解思路&#xff0c;其它不做过多叙述。 目录 6-1 鸡兔同笼问题6-2 冒泡排序6-3 字符串反正序连接6-4 计算最长的字符串长度6-5 查找星期7-1 C程序设计 实验5-7 数组指针作函数参数7-2 查…

使用glBlitFramebuffer将2D多采样纹理转换为2D普通纹理的教程

介绍&#xff1a; 在计算机图形编程中&#xff0c;有时你可能需要将2D多采样纹理转换为普通2D纹理。这种转换在实现不需要多采样的后处理效果时非常有用。OpenGL中的glBlitFramebuffer函数为高效实现此转换提供了便捷的方法。本教程将指导你如何使用glBlitFramebuffer从多采样…

【数据结构】哈夫曼树(Huffman Tree)和哈夫曼编码(Huffman Coding)

哈夫曼树&#xff08;Huffman Tree&#xff09;和哈夫曼编码&#xff08;Huffman Coding&#xff09;是数据压缩领域常用的技术。哈夫曼树是一种特殊的二叉树&#xff0c;用于构造哈夫曼编码&#xff0c;而哈夫曼编码则是一种变长编码&#xff0c;用于压缩数据。 在解释哈夫曼…

文心一言 VS 讯飞星火 VS chatgpt (147)-- 算法导论12.2 2题

二、用go语言&#xff0c;写出 TREE-MINIMUM 和 TREE-MAXIMUM 的递归版本。 灵捷3.5 。 文心一言&#xff1a; 以下是用 Go 语言编写的树的最大值和最小值的递归版本代码&#xff1a; package main import ( "fmt" ) type TreeNode struct { Val int Le…

【tower-boot 系列】MybatisPlus 集成

Mybatis、MybatisPlus 简单介绍 MybatisPlus 集成 一、pom 依赖 <dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-jdbc</artifactId><exclusions><exclusion><groupId>com.zaxxer…

docker-compose命令

&#xff08;1&#xff09;定义 compose是用于定义和运行多容器docker应用程序的工具。 通过compose&#xff0c;使用yml文件来配置应用程序需要的所有服务。然后&#xff0c;使用一个命令&#xff0c;就可以从yml文件配置中创建并启动所有服务。 &#xff08;2&#xff09;模板…

将Linux 标准输出,错误输出重定向到文件

将Linux 标准输出&#xff0c;错误输出重定 1.想要把make输出的全部信息&#xff0c;输出到某个文件中&#xff0c;最常见的办法就是&#xff1a; make xxx > build_output.txt 此时默认情况是没有改变2stderr的输出方式&#xff0c;还是屏幕&#xff0c;所以&#xff0c…

opencv学习一:namedWindow()创建和显示窗口

文章目录 opencv图像视频的加载和显示一、namedWindow()创建和显示窗口&#xff08;一&#xff09;函数1.namedWindow()创建命名窗口2.imshow() 显示窗口3.destroyAllwindws()摧毁窗口4.resizeWindow() 改变窗口大小5.waitKey() 等待用户输入 &#xff08;二&#xff09;代码 o…

python简单进阶之web框架:fastapi使用教程

原文&#xff1a;python简单进阶之web框架&#xff1a;fastapi使用教程 - 知乎 这是简单进阶教程系列第四篇&#xff0c;本系列文章主要介绍那些可以很快上手的进阶库。 我其实学过一段时间Django框架&#xff0c;但是半途而废了&#xff0c;我觉得可能还是简单一点的框架比较适…

智能优化算法应用:基于象群算法无线传感器网络(WSN)覆盖优化 - 附代码

智能优化算法应用&#xff1a;基于象群算法无线传感器网络(WSN)覆盖优化 - 附代码 文章目录 智能优化算法应用&#xff1a;基于象群算法无线传感器网络(WSN)覆盖优化 - 附代码1.无线传感网络节点模型2.覆盖数学模型及分析3.象群算法4.实验参数设定5.算法结果6.参考文献7.MATLAB…

JavaScript 一只青蛙想要过河

一只青蛙想要过河。 假定河流被等分为若干个单元格&#xff0c;并且在每一个单元格内都有可能放有一块石子&#xff08;也有可能没有&#xff09;。 青蛙可以跳上石子&#xff0c;但是不可以跳入水中。 给你石子的位置列表 stones&#xff08;用单元格序号 升序 表示&#xf…

什么是堆内存?参数如何设置?

文章目录 什么是堆内存&#xff1f;参数如何设置&#xff1f; 栈和队列&#xff0c;举个使用场景例子&#xff1f; 什么是堆内存&#xff1f;参数如何设置&#xff1f; 堆内存是指由程序代码自由分配的内存&#xff0c;与栈内存作区分。 在 Java 中&#xff0c;堆内存主要用于…

网络类型解析(基础):探索通信世界的多样面貌

在当今数字化时代&#xff0c;网络已经成为人们生活和工作中不可或缺的一部分。从个人设备之间的直接通信到全球范围的数据传输&#xff0c;不同类型的网络为我们提供了多种连接方式和通信选择。透过对这些网络类型的解析&#xff0c;我们将更好地理解它们的特点、优势和适用场…

JMX的使用

1. 定义和意义 JMX是Java Management Extention的缩写&#xff0c;出发点是让外部通过属性/方法来读取或设置程序状态。对于提供对外服务的程序来说&#xff0c;天生就有这样的能力&#xff0c;Web程序通过HTTP接口对外暴露&#xff0c;RPC应用通过RPC接口暴露。不过带来的问…

ESP32-Web-Server编程- 使用表格(Table)实时显示设备信息

ESP32-Web-Server编程- 使用表格&#xff08;Table&#xff09;实时显示设备信息 概述 上节讲述了通过 Server-Sent Events&#xff08;以下简称 SSE&#xff09; 实现在网页实时更新 ESP32 Web 服务器的传感器数据。 本节书接上会&#xff0c;继续使用 SSE 机制在网页实时显…

如何优化 Elasticsearch 以获得更好的搜索性能

当今世界&#xff0c;数据大量生成&#xff0c;为了利用数据进行生产&#xff0c;需要对提取的数据进行转换、存储、维护、管理和分析。这些过程只有通过大数据工具所基于的分布式架构和并行处理机制才能实现。Elasticsearch 是最流行的开源数据存储之一&#xff0c;可以满足大…

邻接表表示图进行深度优先搜索,广度优先搜索,最小生成树

图的邻接表定义 下面用邻接表实现图的深度优先搜索和广度优先搜索&#xff0c;用邻接矩阵来实现最小生成树。 图的邻接表&#xff1a;首先定义一个图的邻接表的类&#xff0c;里面包括图的顶点数&#xff0c;图的边数&#xff0c;顶点表数组。由于顶点表数组里存放的都是图的…