From c359dc6396ea774ab9db02d37f468064ef313077 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?16=20=E9=98=99=E8=8B=8F=E6=96=87?= <2361635242@qq.com> Date: Wed, 6 Sep 2023 12:28:34 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../\344\275\234\344\270\232.txt" | 1 + 1 file changed, 1 insertion(+) create mode 100644 "16 \351\230\231\350\213\217\346\226\207/\344\275\234\344\270\232.txt" diff --git "a/16 \351\230\231\350\213\217\346\226\207/\344\275\234\344\270\232.txt" "b/16 \351\230\231\350\213\217\346\226\207/\344\275\234\344\270\232.txt" new file mode 100644 index 0000000..bd41cba --- /dev/null +++ "b/16 \351\230\231\350\213\217\346\226\207/\344\275\234\344\270\232.txt" @@ -0,0 +1 @@ +12345 \ No newline at end of file -- Gitee From 21ffca7bd2238acca507920f1a54a413d9a5eaf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=99=E8=8B=8F=E6=96=87?= <12071386+que-su-wen@user.noreply.gitee.com> Date: Wed, 6 Sep 2023 04:29:00 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=2016?= =?UTF-8?q?=20=E9=98=99=E8=8B=8F=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../\344\275\234\344\270\232.txt" | 1 - 1 file changed, 1 deletion(-) delete mode 100644 "16 \351\230\231\350\213\217\346\226\207/\344\275\234\344\270\232.txt" diff --git "a/16 \351\230\231\350\213\217\346\226\207/\344\275\234\344\270\232.txt" "b/16 \351\230\231\350\213\217\346\226\207/\344\275\234\344\270\232.txt" deleted file mode 100644 index bd41cba..0000000 --- "a/16 \351\230\231\350\213\217\346\226\207/\344\275\234\344\270\232.txt" +++ /dev/null @@ -1 +0,0 @@ -12345 \ No newline at end of file -- Gitee From 4e9356b206ff783596290ef218c4a9e696aa7487 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?16=20=E9=98=99=E8=8B=8F=E6=96=87?= <2361635242@qq.com> Date: Thu, 7 Sep 2023 13:32:54 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../\344\275\234\344\270\232.txt" | 1 - ...0\346\254\241\347\254\224\350\256\260 .md" | 23 ++++ ...60\345\222\214\344\275\234\344\270\232.md" | 129 ++++++++++++++++++ 3 files changed, 152 insertions(+), 1 deletion(-) delete mode 100644 "16 \351\230\231\350\213\217\346\226\207/\344\275\234\344\270\232.txt" create mode 100644 "16 \351\230\231\350\213\217\346\226\207/\347\254\254\344\270\200\346\254\241\347\254\224\350\256\260 .md" create mode 100644 "16 \351\230\231\350\213\217\346\226\207/\347\254\254\344\272\214\346\254\241\347\254\224\350\256\260\345\222\214\344\275\234\344\270\232.md" diff --git "a/16 \351\230\231\350\213\217\346\226\207/\344\275\234\344\270\232.txt" "b/16 \351\230\231\350\213\217\346\226\207/\344\275\234\344\270\232.txt" deleted file mode 100644 index bd41cba..0000000 --- "a/16 \351\230\231\350\213\217\346\226\207/\344\275\234\344\270\232.txt" +++ /dev/null @@ -1 +0,0 @@ -12345 \ No newline at end of file diff --git "a/16 \351\230\231\350\213\217\346\226\207/\347\254\254\344\270\200\346\254\241\347\254\224\350\256\260 .md" "b/16 \351\230\231\350\213\217\346\226\207/\347\254\254\344\270\200\346\254\241\347\254\224\350\256\260 .md" new file mode 100644 index 0000000..2b95d7f --- /dev/null +++ "b/16 \351\230\231\350\213\217\346\226\207/\347\254\254\344\270\200\346\254\241\347\254\224\350\256\260 .md" @@ -0,0 +1,23 @@ +# 笔记 + +## 一, + +大一:理论,打突牢基础,学基础知况为大二铺路; + +大二:实际应用(实操).学习MySQL高级Janascript(Aiax)、MVC框架(全称:model view controller) + +大二下实训:{ + +1.linux服务器;nginx + +2.项目中可能实现的技术:中间件,签权:鉴别权限 + +3.小程序:uniapp移动端开发, + +} + +课后知识普及: + +技术栈:一个项目要求用什么技术来实现,可以称为技术选型 + +技能树:一个人具备的技能。称为技术树(通俗来讲就一个人的天赋加点) \ No newline at end of file diff --git "a/16 \351\230\231\350\213\217\346\226\207/\347\254\254\344\272\214\346\254\241\347\254\224\350\256\260\345\222\214\344\275\234\344\270\232.md" "b/16 \351\230\231\350\213\217\346\226\207/\347\254\254\344\272\214\346\254\241\347\254\224\350\256\260\345\222\214\344\275\234\344\270\232.md" new file mode 100644 index 0000000..a59a920 --- /dev/null +++ "b/16 \351\230\231\350\213\217\346\226\207/\347\254\254\344\272\214\346\254\241\347\254\224\350\256\260\345\222\214\344\275\234\344\270\232.md" @@ -0,0 +1,129 @@ +# 笔记 + +## 一, + +表关系是相互的:一个学生,可以选多个课程;一个课程可以被多个学生选择,必须引用第三个表; + +表与表之间的关系:1对多,1对1,多对多; + +1对1:将其中任意一表中的主键,放到另一个表中当外键; + +1对多:将一所在的表的王键,放到物的表当外键 + +多对多:必须有第三张表 ,将前面二张表的主键放来当外建 + +## 二, + +数据库设计方法: + +{ + +1.直观设计法(手工试凑发), + +2,.规范设计法, + +3.计算机车辅助设计法; + +}; + +## 三, + +ER图三要素:实体,属性,关系; + +# 作业 + +```mysql +#创建数据库 +create DATABASE homework CHARSET utf8; +use homework; +#院系表 +CREATE table department( + department_id int auto_increment primary KEY,#院系编号 + department_name varchar(20) not null #院系名称 +); +#插入数据 +insert into department values (1,'软件工程学院'),(2,'信息工程学院'); +#专业表 +create table major( + major_id int auto_increment primary key, #专业编号 + major_name VARCHAR(20) not null, #专业名称 + department_id int #院系编号 + foreign key (department_id) references department(department_id) +); +#插入数据 +insert into major VALUES (1,'后端',1),(2,'后端',1); +#专业班级表(中间表) +create table majorclass( + majorclass_id int auto_increment primary key, #专班编号 + major_id int, #专业编号 + class_id int #班级编号 + FOREIGN key (major_id) REFERENCES major(major_id) +); +#插入数据 +insert into majorclass VALUES (1,1,2),(2,2,1); +#班级表 +create table class( + class_id int auto_increment primary key, #班级编号 + class_name varchar(20) not null, #班级名称 + grade int +); +#插入数据 +insert into class VALUES (1,'一班',22),(2,'二班',23); +#学生表 +CREATE table student( + student_id int auto_increment primary key, #学号 + student_name varchar(20) not null, #姓名 + student_class varchar(20) not null, #班级 + major_id int, #专业编号 + FOREIGN key (major_id) REFERENCES major_id(major_id) +); +#插入数据 +insert into student VALUES (1,'小明','一班',1),(2,'小刚','二班',2); +#教师表 +CREATE TABLE teacher( + job_id int auto_increment primary key, #工号 + job_name VARCHAR(20) not null #姓名 +); +#插入数据 +insert into teacher VALUES(1,'王老师'),(2,'李老师'); +#教师班级表(中间表) +create table teacherclass ( + teacherclass_id int auto_increment PRIMARY key, #教师班级编号 + job_id int, #工号 + class_id int #班级编号 +); +#插入数据 +INSERT into teacherclass VALUES(1,1,1),(2,2,1); +#课程 +CREATE table curriculum( + curriculum_id int auto_increment PRIMARY key, #课程编号 + curriculum_name VARCHAR(20) not null, #课程名称 + Lecturer VARCHAR(20) NOT null #授课老师 + FOREIGN key (Lecturer) REFERENCES major_id(job_name) +); +#插入数据 +INSERT into curriculum VALUES(1,'java','王老师'),(2,'mysql','李老师'); +#教室 +create table classroom( + classroom_id int auto_increment PRIMARY key, #教室编号 + classroom_name VARCHAR(20) not null #教室名称 +); +#插入数据 +INSERT into classroom VALUES(1,'望云楼'),(2,'辛耕楼'); +#课程表 +CREATE TABLE curr( + curr_id int auto_increment PRIMARY key, #课程编号 + classroom_id int , #教室编号 + curriculum_name VARCHAR(20) not null, #课程名称 + student_class varchar(20) not null, #班级 + week VARCHAR(20) not null , #星期 + section int #节次 + FOREIGN key (curr_id) REFERENCES curriculum(curriculum_id), + FOREIGN key (classroom_id) REFERENCES classroom(classroom), + FOREIGN key (curriculum_name) REFERENCES curriculum(curriculum_name), + FOREIGN key (student_class) REFERENCES student(student_class) +); +#插入数据 +INSERT into curr VALUES(1,1,'java','一班','星期一',4),(2,2,'java','二班','星期二',2); +``` + -- Gitee