From 49f4db770edd586e6f0b8dd9ef1f47251ed9e704 Mon Sep 17 00:00:00 2001 From: youyilin <3215017830@qq.com> Date: Sat, 7 Sep 2024 22:53:13 +0800 Subject: [PATCH] test --- ...3 \346\225\260\346\215\256\345\272\223.md" | 148 ++++++++++++++++++ ...or\357\274\214\345\233\276\345\272\212.md" | 26 +++ 2 files changed, 174 insertions(+) create mode 100644 "\346\270\270\344\271\231\351\272\237/20240903 \346\225\260\346\215\256\345\272\223.md" create mode 100644 "\346\270\270\344\271\231\351\272\237/20240907 git\357\274\214picgo\357\274\214Typor\357\274\214\345\233\276\345\272\212.md" diff --git "a/\346\270\270\344\271\231\351\272\237/20240903 \346\225\260\346\215\256\345\272\223.md" "b/\346\270\270\344\271\231\351\272\237/20240903 \346\225\260\346\215\256\345\272\223.md" new file mode 100644 index 0000000..88c6270 --- /dev/null +++ "b/\346\270\270\344\271\231\351\272\237/20240903 \346\225\260\346\215\256\345\272\223.md" @@ -0,0 +1,148 @@ +# 笔记 + +## 一、表与表之间的关系 + +### 1.一对一 +表中一行,对应另一表中的一行 + +### 2.一对多 +表1中的一行数据,可以关联表2的多行数据。 + +### 3.多对多 +表1中的一条数据,可以关联表2的多条数据,反之亦然 + + +## 二、三大范式 + +### 1NF + +原子性,不可再分割 + +### 2NF + +非主键要完全依赖主键,不能部分依赖,就消除部分依赖 + +### 3NF + +消除传递依赖 + +# 作业 + + +##### 1.统计玩家玩的游戏 + +##### 2.统计玩家拥有的账号 + +##### 3.登记玩家的身份 + +## 查询语句 + +### 1.查询所有玩家 + +```sql +select * from play; +``` + +### 2.查询游戏数量 + +```sql +select count(*) from game; +``` + +## 1.CDM:概念模型 + +## 2.LDM:逻辑模型 + +## 3.PDM:物理模型 + +![屏幕截图 2024-09-04 205138](https://gitee.com/zsxqdqjt69/picture-bed/raw/master/images/202409071933095.png) + +![屏幕截图 2024-09-04 210241](https://gitee.com/zsxqdqjt69/picture-bed/raw/master/images/202409071934204.png) + +![屏幕截图 2024-09-04 210023](https://gitee.com/zsxqdqjt69/picture-bed/raw/master/images/202409071934583.png) + +```sql +/*==============================================================*/ +/* DBMS name: MySQL 5.0 */ +/* Created on: 2024/9/4 21:01:44 */ +/*==============================================================*/ + + +drop table if exists Account; + +drop table if exists game; + +drop table if exists id_card; + +drop table if exists play; + +drop table if exists playy; + +/*==============================================================*/ +/* Table: Account */ +/*==============================================================*/ +create table Account +( + u_id int not null, + p_id int, + u_name varchar(10), + u_pass varchar(10), + primary key (u_id) +); + +/*==============================================================*/ +/* Table: game */ +/*==============================================================*/ +create table game +( + g_id int not null, + g_name varchar(10), + primary key (g_id) +); + +/*==============================================================*/ +/* Table: id_card */ +/*==============================================================*/ +create table id_card +( + id int not null, + id_num varchar(18), + id_name varchar(10), + primary key (id) +); + +/*==============================================================*/ +/* Table: play */ +/*==============================================================*/ +create table play +( + p_id int not null, + id int not null, + p_name varchar(10), + primary key (p_id) +); + +/*==============================================================*/ +/* Table: playy */ +/*==============================================================*/ +create table playy +( + g_id int not null, + p_id int not null, + primary key (g_id, p_id) +); + +alter table Account add constraint FK_possess foreign key (p_id) + references play (p_id) on delete restrict on update restrict; + +alter table play add constraint FK_relevancy foreign key (id) + references id_card (id) on delete restrict on update restrict; + +alter table playy add constraint FK_playy foreign key (g_id) + references game (g_id) on delete restrict on update restrict; + +alter table playy add constraint FK_playy2 foreign key (p_id) + references play (p_id) on delete restrict on update restrict; + +``` + diff --git "a/\346\270\270\344\271\231\351\272\237/20240907 git\357\274\214picgo\357\274\214Typor\357\274\214\345\233\276\345\272\212.md" "b/\346\270\270\344\271\231\351\272\237/20240907 git\357\274\214picgo\357\274\214Typor\357\274\214\345\233\276\345\272\212.md" new file mode 100644 index 0000000..470d1ec --- /dev/null +++ "b/\346\270\270\344\271\231\351\272\237/20240907 git\357\274\214picgo\357\274\214Typor\357\274\214\345\233\276\345\272\212.md" @@ -0,0 +1,26 @@ +# 一、图床使用方法 + +## 1. gitee当图床: + +用来存图片 + +## 2. 安装picgo + 安装gitee uploader的插件设置这个插件,仓库的地址,私人令牌 + +## 3. 配置typroa使用picgo + +# 二、交作业 + +1.将班级仓库fork到个人仓库 + +2.克隆个人仓库到本地 + +3.进入本地仓库新建个人目录,在目录里新建笔记文件 + +4.回到本地仓库文件夹使用提交代码 + +``` +git add . # 添加当前目录到仓库 +git commit -m '备注的文件 ' # 添加备注 +git push # 将本地仓库推送回个人仓库 +``` -- Gitee