diff --git "a/26\351\231\210\346\231\223\347\201\277/20230908 \344\275\234\344\270\232.md" "b/26\351\231\210\346\231\223\347\201\277/20230908 \344\275\234\344\270\232.md" new file mode 100644 index 0000000000000000000000000000000000000000..5988df249ffaf9a214a387f379ab2c428e72c3a3 --- /dev/null +++ "b/26\351\231\210\346\231\223\347\201\277/20230908 \344\275\234\344\270\232.md" @@ -0,0 +1,180 @@ +# day0908 + +今天学习了一个新的软件:PowerDesigner + +这个软件可以用来生成数据库模型 数据库语句,创建表的结构,大大提升了我们创建数据库的速度 + +对我们的学习有着很大的帮助 + +## 作业: + +~~~mysql + + +# 作业 + +```MySQL +/*==============================================================*/ +/* DBMS name: MySQL 5.0 */ +/* Created on: 2023/9/10 23:08:03 */ +/*==============================================================*/ + + +create database tsg charset utf8; +use tsg; + +drop table if exists apply; + +drop table if exists books; + +drop table if exists bulletin; + +drop table if exists jy; + +drop table if exists library; + +drop table if exists manage; + +drop table if exists pl; + +drop table if exists sc; + +drop table if exists student; + +/*==============================================================*/ +/* Table: apply */ +/*==============================================================*/ +create table apply +( + app_id int not null auto_increment, + stu_id int not null, + man_id int, + add_time time not null, + add_status char(5) not null, + add_cause varchar(11) not null, + add_persontime time not null, + primary key (app_id) +); + +/*==============================================================*/ +/* Table: books */ +/*==============================================================*/ +create table books +( + bo_id int not null auto_increment, + man_id int not null, + bo_name varchar(11) not null, + bo_type varchar(10) not null, + bo_author char(10) not null, + bo_brief varchar(11) not null, + bo_press varchar(10) not null, + bo_status char(5) not null, + primary key (bo_id) +); + +insert into books values (1,1,"水浒传","奇幻","施耐庵","简介","某某出版社","出借"); + +/*==============================================================*/ +/* Table: bulletin */ +/*==============================================================*/ +create table bulletin +( + bu_id int not null auto_increment, + man_id int not null, + bu_title char(10) not null, + bu_content varchar(11) not null, + bu_time time not null, + bu_delete char(10) not null, + primary key (bu_id) +); +insert into bulletin values(1,1,"公告","内容","23:00:00","否"); + +/*==============================================================*/ +/* Table: jy */ +/*==============================================================*/ +create table jy +( + bo_id int not null, + stu_id int not null, + jy_id int, + man_id int, + jy_time time, + jy_zt char(2), + jy_sh time, + jy_yy varchar(11), + jy_gh time, + primary key (bo_id, stu_id) +); +insert into jy values(1,1,1,1,"15:00:00","出借","16:00:00","未拒绝",""); + +/*==============================================================*/ +/* Table: library */ +/*==============================================================*/ +create table library +( + li_id int not null auto_increment, + app_id int not null, + primary key (li_id) +); +insert into library values(1,1); + +/*==============================================================*/ +/* Table: manage */ +/*==============================================================*/ +create table manage +( + man_id int not null auto_increment, + primary key (man_id) +); +insert into manage values(1); + +/*==============================================================*/ +/* Table: pl */ +/*==============================================================*/ +create table pl +( + bo_id int not null, + stu_id int not null, + pl_id int, + pl_pf int, + pl_nr varchar(11), + pl_time time, + primary key (bo_id, stu_id) +); +insert into pl values(1,1,1,100,"非常经典","15:00:00"); + + +/*==============================================================*/ +/* Table: sc */ +/*==============================================================*/ +create table sc +( + bo_id int not null, + stu_id int not null, + sc_id int, + sc_time time, + sc_qx char(2), + sc_qxtime time, + primary key (bo_id, stu_id) +); +insert into sc values(1,1,1,"10:00:00","否",""); + +/*==============================================================*/ +/* Table: student */ +/*==============================================================*/ +create table student +( + stu_id int not null auto_increment, + stu_name char(8) not null, + stu_belong char(8) not null, + stu_sex char(3) not null, + primary key (stu_id) +); +insert into student values(1,"王路","二班","女"); + + + + +``` +~~~ +