diff --git "a/53 \345\221\250\345\216\232\350\276\260/20230913\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232 \345\214\273\347\224\237\346\225\260\346\215\256\345\272\223/Doctor.png" "b/53 \345\221\250\345\216\232\350\276\260/20230913\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232 \345\214\273\347\224\237\346\225\260\346\215\256\345\272\223/Doctor.png" new file mode 100644 index 0000000000000000000000000000000000000000..223af1235dfa9c01492c46176e7efb040ec259f3 Binary files /dev/null and "b/53 \345\221\250\345\216\232\350\276\260/20230913\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232 \345\214\273\347\224\237\346\225\260\346\215\256\345\272\223/Doctor.png" differ diff --git "a/53 \345\221\250\345\216\232\350\276\260/20230913\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232 \345\214\273\347\224\237\346\225\260\346\215\256\345\272\223/\345\214\273\347\224\237.sql" "b/53 \345\221\250\345\216\232\350\276\260/20230913\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232 \345\214\273\347\224\237\346\225\260\346\215\256\345\272\223/\345\214\273\347\224\237.sql" new file mode 100644 index 0000000000000000000000000000000000000000..1e9d61fc92e05009aa1be4ad8cdaae2e91fee209 --- /dev/null +++ "b/53 \345\221\250\345\216\232\350\276\260/20230913\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232 \345\214\273\347\224\237\346\225\260\346\215\256\345\272\223/\345\214\273\347\224\237.sql" @@ -0,0 +1,169 @@ +/*==============================================================*/ +/* DBMS name: MySQL 5.0 */ +/* Created on: 2023/9/13 20:31:06 */ +/*==============================================================*/ +drop database if exists doctor; +create database if not exists doctor charset utf8; +use doctor; + +drop table if exists chu_fang; + +drop table if exists dep; + +drop table if exists doctor; + +drop table if exists fee_record; + +drop table if exists guahao; + +drop table if exists medicine; + +drop table if exists patient; + +drop table if exists registration_fee; + +drop table if exists yi_zhu; + +/*==============================================================*/ +/* Table: chu_fang */ +/*==============================================================*/ +create table chu_fang +( + chu_fang_No int not null auto_increment, + doctor_No char(10), + yao_pin_No int not null, + count int not null, + primary key (chu_fang_No) +); + +/*==============================================================*/ +/* Table: dep */ +/*==============================================================*/ +create table dep +( + dep_No int not null auto_increment, + dep_name varchar(10) not null, + dep_tel numeric(11,0) not null, + kezhang_No int not null, + primary key (dep_No) +); + +/*==============================================================*/ +/* Table: doctor */ +/*==============================================================*/ +create table doctor +( + doctor_No char(10) not null, + doctor_job2 varchar(10), + dep_No int, + dep_name varchar(10) not null, + dep_tel numeric(11,0) not null, + kezhang_No int not null, + doctor_job char(10) not null, + primary key (doctor_No) +); + +/*==============================================================*/ +/* Table: fee_record */ +/*==============================================================*/ +create table fee_record +( + record_No int not null auto_increment, + patient_No int, + patinent_No numeric(9,0) not null, + deal_fee decimal(9,2) not null, + record_time datetime not null, + primary key (record_No) +); + +/*==============================================================*/ +/* Table: guahao */ +/*==============================================================*/ +create table guahao +( + doctor_No char(10) not null, + patient_No int not null, + guahao_No char(10) not null, + primary key (doctor_No, patient_No, guahao_No) +); + +/*==============================================================*/ +/* Table: medicine */ +/*==============================================================*/ +create table medicine +( + medicine_No int not null auto_increment, + medicine_name char(10) not null, + medicine_type char(10) not null, + medicine_specification varchar(10) not null, + medicine_price decimal(9,2) not null, + medicine_repertory int not null, + primary key (medicine_No) +); + +/*==============================================================*/ +/* Table: patient */ +/*==============================================================*/ +create table patient +( + patient_No int not null auto_increment, + patient_name char(10) not null, + patient_gender char(1) not null, + patient_ID numeric(18,0) not null, + patient_tel numeric(11,0) not null, + patient_balance decimal(9,2) not null, + primary key (patient_No) +); + +/*==============================================================*/ +/* Table: registration_fee */ +/*==============================================================*/ +create table registration_fee +( + doctor_job2 varchar(10) not null, + registration_fee decimal(9,2) not null, + primary key (doctor_job2) +); + +/*==============================================================*/ +/* Table: yi_zhu */ +/*==============================================================*/ +create table yi_zhu +( + yi_zhu_No int not null auto_increment, + chu_fang_No int, + medicine_No int, + yao_pin_No int not null, + count int not null, + danciyongliang int not null, + pinci int not null, + geiyaofangfa varchar(10) not null, + doctor_No2 int not null, + chufang_No int not null, + primary key (yi_zhu_No) +); + +alter table chu_fang add constraint FK_kaichufang foreign key (doctor_No) + references doctor (doctor_No) on delete restrict on update restrict; + +alter table doctor add constraint FK_have2 foreign key (doctor_job2) + references registration_fee (doctor_job2) on delete restrict on update restrict; + +alter table doctor add constraint FK_pin_yonng foreign key (dep_No) + references dep (dep_No) on delete restrict on update restrict; + +alter table fee_record add constraint FK_have foreign key (patient_No) + references patient (patient_No) on delete restrict on update restrict; + +alter table guahao add constraint FK_Relationship_2 foreign key (doctor_No) + references doctor (doctor_No) on delete restrict on update restrict; + +alter table guahao add constraint FK_Relationship_3 foreign key (patient_No) + references patient (patient_No) on delete restrict on update restrict; + +alter table yi_zhu add constraint FK_kaiyao foreign key (medicine_No) + references medicine (medicine_No) on delete restrict on update restrict; + +alter table yi_zhu add constraint FK_shuyu foreign key (chu_fang_No) + references chu_fang (chu_fang_No) on delete restrict on update restrict; + diff --git "a/53 \345\221\250\345\216\232\350\276\260/20230913\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232 \345\214\273\347\224\237\346\225\260\346\215\256\345\272\223/\345\214\273\347\224\237\346\225\260\346\215\256\345\272\223.md" "b/53 \345\221\250\345\216\232\350\276\260/20230913\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232 \345\214\273\347\224\237\346\225\260\346\215\256\345\272\223/\345\214\273\347\224\237\346\225\260\346\215\256\345\272\223.md" new file mode 100644 index 0000000000000000000000000000000000000000..97d1ea6d8950f80f03a5ed14d2f2c6e5a6161fd5 --- /dev/null +++ "b/53 \345\221\250\345\216\232\350\276\260/20230913\347\254\254\345\205\255\346\254\241\344\275\234\344\270\232 \345\214\273\347\224\237\346\225\260\346\215\256\345\272\223/\345\214\273\347\224\237\346\225\260\346\215\256\345\272\223.md" @@ -0,0 +1,178 @@ +# 2023年9月13日 医生数据库 + +[![pPRF7uD.md.png](https://z1.ax1x.com/2023/09/13/pPRF7uD.md.png)](https://imgse.com/i/pPRF7uD) + +```mysql + +/*==============================================================*/ +/* DBMS name: MySQL 5.0 */ +/* Created on: 2023/9/13 20:31:06 */ +/*==============================================================*/ +drop database if exists doctor; +create database if not exists doctor charset utf8; +use doctor; + +drop table if exists chu_fang; + +drop table if exists dep; + +drop table if exists doctor; + +drop table if exists fee_record; + +drop table if exists guahao; + +drop table if exists medicine; + +drop table if exists patient; + +drop table if exists registration_fee; + +drop table if exists yi_zhu; + +/*==============================================================*/ +/* Table: chu_fang */ +/*==============================================================*/ +create table chu_fang +( + chu_fang_No int not null auto_increment, + doctor_No char(10), + yao_pin_No int not null, + count int not null, + primary key (chu_fang_No) +); + +/*==============================================================*/ +/* Table: dep */ +/*==============================================================*/ +create table dep +( + dep_No int not null auto_increment, + dep_name varchar(10) not null, + dep_tel numeric(11,0) not null, + kezhang_No int not null, + primary key (dep_No) +); + +/*==============================================================*/ +/* Table: doctor */ +/*==============================================================*/ +create table doctor +( + doctor_No char(10) not null, + doctor_job2 varchar(10), + dep_No int, + dep_name varchar(10) not null, + dep_tel numeric(11,0) not null, + kezhang_No int not null, + doctor_job char(10) not null, + primary key (doctor_No) +); + +/*==============================================================*/ +/* Table: fee_record */ +/*==============================================================*/ +create table fee_record +( + record_No int not null auto_increment, + patient_No int, + patinent_No numeric(9,0) not null, + deal_fee decimal(9,2) not null, + record_time datetime not null, + primary key (record_No) +); + +/*==============================================================*/ +/* Table: guahao */ +/*==============================================================*/ +create table guahao +( + doctor_No char(10) not null, + patient_No int not null, + guahao_No char(10) not null, + primary key (doctor_No, patient_No, guahao_No) +); + +/*==============================================================*/ +/* Table: medicine */ +/*==============================================================*/ +create table medicine +( + medicine_No int not null auto_increment, + medicine_name char(10) not null, + medicine_type char(10) not null, + medicine_specification varchar(10) not null, + medicine_price decimal(9,2) not null, + medicine_repertory int not null, + primary key (medicine_No) +); + +/*==============================================================*/ +/* Table: patient */ +/*==============================================================*/ +create table patient +( + patient_No int not null auto_increment, + patient_name char(10) not null, + patient_gender char(1) not null, + patient_ID numeric(18,0) not null, + patient_tel numeric(11,0) not null, + patient_balance decimal(9,2) not null, + primary key (patient_No) +); + +/*==============================================================*/ +/* Table: registration_fee */ +/*==============================================================*/ +create table registration_fee +( + doctor_job2 varchar(10) not null, + registration_fee decimal(9,2) not null, + primary key (doctor_job2) +); + +/*==============================================================*/ +/* Table: yi_zhu */ +/*==============================================================*/ +create table yi_zhu +( + yi_zhu_No int not null auto_increment, + chu_fang_No int, + medicine_No int, + yao_pin_No int not null, + count int not null, + danciyongliang int not null, + pinci int not null, + geiyaofangfa varchar(10) not null, + doctor_No2 int not null, + chufang_No int not null, + primary key (yi_zhu_No) +); + +alter table chu_fang add constraint FK_kaichufang foreign key (doctor_No) + references doctor (doctor_No) on delete restrict on update restrict; + +alter table doctor add constraint FK_have2 foreign key (doctor_job2) + references registration_fee (doctor_job2) on delete restrict on update restrict; + +alter table doctor add constraint FK_pin_yonng foreign key (dep_No) + references dep (dep_No) on delete restrict on update restrict; + +alter table fee_record add constraint FK_have foreign key (patient_No) + references patient (patient_No) on delete restrict on update restrict; + +alter table guahao add constraint FK_Relationship_2 foreign key (doctor_No) + references doctor (doctor_No) on delete restrict on update restrict; + +alter table guahao add constraint FK_Relationship_3 foreign key (patient_No) + references patient (patient_No) on delete restrict on update restrict; + +alter table yi_zhu add constraint FK_kaiyao foreign key (medicine_No) + references medicine (medicine_No) on delete restrict on update restrict; + +alter table yi_zhu add constraint FK_shuyu foreign key (chu_fang_No) + references chu_fang (chu_fang_No) on delete restrict on update restrict; + + +``` +