资源描述:
《医诊信息管理系统》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、医诊信息管理系统某医院病房计算机管理中需要如下信息:科室:科名,科地址,科电话,医生姓名病房:病房号,床位号,所属科室名医生:姓名,职称,所属科室名,年龄,工作证号病人:病历号,姓名,性别,诊断,主管医生,病房号其中,一个科室可有多个病房、多个医生,一个病房只能属于一个科室,一个医生只属于一个科室,但可负责多个病人的诊治,一个病人的主管医生只有一个。完成如下设计:(1)设计该计算机管理系统的E-R图;(2)将该E-R图转换为关系模型结构;(3)指出转换结果中每个关系模式的候选码。department(dename,deaddress,tel,doname)sickroom
2、(roomno,bednumber,dename)doctor(doname,position,dename,age,dono)patient(medicalno,pname,sex,diagnose,dono,roomno)五张表:department(dename,deaddress,tel)dename主码sickroom(roomno,dename)roomno主码bed(bedno,roomno)bedno主码doctor(dono,doname,position,dename,age)dono主码patient(pname,medicalno,sex,diag
3、nose,dono,roomno)pname主码CREATEINDEXIDX_NAMEONdoctor(doname)createdatabase医诊信息管理系统createtabledepartment(denamenvarchar(30)primarykey,deaddressnvarchar(30)notnull,telchar(15)notnull)createtablesickroom(roomnonvarchar(30)primarykey,denamenvarchar(30)notnull,foreignkey(dename)referencesdepart
4、ment(dename))createtablebed(bednonvarchar(30)primarykey,roomnonvarchar(30)notnull,foreignkey(roomno)referencessickroom(roomno))createtabledoctor(dononvarchar(30)primarykey,donamenvarchar(35)notnull,positionnvarchar(30)notnull,denamenvarchar(30)notnull,agebigintcheck(age>=10andage<=100),fo
5、reignkey(dename)referencesdepartment(dename))createtablepatient(pnamenvarchar(30)primarykey,medicalnonvarchar(30)notnull,sexnchar(1)check(sex='男'orsex='女'),diagnosenvarchar(30)notnull,dononvarchar(30)notnull,roomnonvarchar(30)notnull,foreignkey(dono)referencesdoctor(dono),foreignkey(roomn
6、o)referencessickroom(roomno))select*frombedselect*fromdepartmentselect*fromdoctorselect*frompatientselect*fromsickroomselect*frombedwherebedno='BED03-04-002'select*fromdepartmentwheredeaddress='四楼'select*fromdoctorwheredoname='马龙'select*frompatientwheresex='男'select*fromsickroomwheredenam
7、e='牙科'deletefrombedwherebedno='BED03-01-001'select*fromsickroomupdatesickroomsetroomno='ROOM03101'select*fromdepartmentinsertintodepartmentvalues('牙科','三楼',4118882221)insertintodepartmentvalues('神经科','四楼',4118882222)insertintodepartmentvalues('内科','五楼',4118882223)in