SQL Server医疗信息管理系统数据库【英文版】

  • 友情连接
    • 1、医疗信息管理系统数据库--MySQL【中文版】
    • 2、邮件管理数据库设计--MySQL【中文版】
    • 3、学生成绩管理系统数据库设计--MySQL
    • 4、点餐系统数据库设计--SQL Server
    • 5、商品管理系统数据库设计--SQL Server
    • 6、SQL Server电影院数据库管理系统【英文版-源码】--(Movie Theatre Management System Database)
  • 1. ER图
  • 2. 创建数据库及数据表、插入数据
  • 3. 查询数据
  • 4. 创建视图

友情连接

1、医疗信息管理系统数据库–MySQL【中文版】

医疗信息管理系统数据库–MySQL【中文版】

2、邮件管理数据库设计–MySQL【中文版】

邮件管理数据库设计–MySQL【中文版】

3、学生成绩管理系统数据库设计–MySQL

学生成绩管理系统数据库设计–MySQL

4、点餐系统数据库设计–SQL Server

点餐系统数据库设计–SQL Server

5、商品管理系统数据库设计–SQL Server

商品管理系统数据库设计–SQL Server

6、SQL Server电影院数据库管理系统【英文版-源码】–(Movie Theatre Management System Database)

SQL Server电影院数据库管理系统【英文版-源码】–(Movie Theatre Management System Database)

1. ER图

2. 创建数据库及数据表、插入数据


--******Create/Drop Databse******-- if MedicalManagementSystem exists, kill current connections to Database
-- make single users
IF DB_ID('MedicalManagementSystem') IS NOT NULLBEGINUSE [MASTER];ALTER    DATABASE [MedicalManagementSystem] SET  SINGLE_USERWITH ROLLBACK IMMEDIATE;DROP DATABASE MedicalManagementSystem;END
GO-- create new database called MedicalManagementSystem
CREATE DATABASE MedicalManagementSystem;
GOUSE MedicalManagementSystem;
GO--******Create Tables*******--table 1: users_info
DROP TABLE IF EXISTS users_info
GO
CREATE TABLE users_info
(id INT NOT NULL IDENTITY(1,1) PRIMARY KEY,first_name VARCHAR(50) NOT NULL,last_name VARCHAR(50) NOT NULL,login_name VARCHAR(20) NOT NULL,password VARCHAR(20) NOT NULL,permit VARCHAR(20) NOT NULL,user_type VARCHAR(20) NOT NULL,gender VARCHAR(10) NOT NULL,age TINYINT NOT NULL,tel VARCHAR(20) NOT NULL,email VARCHAR(50) NOT NULL,address VARCHAR(70) NOT NULL,hire_date DATE NOT NULL
);
GO--table 2: patients_info
DROP TABLE IF EXISTS patients_info
GO
CREATE TABLE patients_info
(
-- 需要完整代码请添加文章底部微信,付费咨询
);
GO--table 3:  drugs_devices_info
DROP TABLE IF EXISTS drugs_devices_info
GO
CREATE TABLE drugs_devices_info
(
-- 需要完整代码请添加文章底部微信,付费咨询
);
GO-- table 4: treat_price
-- copay means cost of registration
-- consultation_fee means cost of diagnosis
DROP TABLE IF EXISTS treat_price
GO
CREATE TABLE treat_price
(
-- 需要完整代码请添加文章底部微信,付费咨询
);
GO-- table 5: appointment
DROP TABLE IF EXISTS appointment
GO
CREATE TABLE appointment
(
-- 需要完整代码请添加文章底部微信,付费咨询
);
GO-- table 6: case_history
DROP TABLE IF EXISTS case_history
GO
CREATE TABLE case_history
(
-- 需要完整代码请添加文章底部微信,付费咨询
);
GO-- table 7: medical_records
DROP TABLE IF EXISTS medical_records
GO
CREATE TABLE medical_records
(
-- 需要完整代码请添加文章底部微信,付费咨询
);
GO-- table 8: nursing
DROP TABLE IF EXISTS nursing
GO
CREATE TABLE nursing
(
-- 需要完整代码请添加文章底部微信,付费咨询
);
GO--******Database Population*******INSERT INTO users_info
VALUES  ('Andrew', 'Adams', 'python', 'jwjehj', 'lowlevel', 'receptionist', 'female', 30, '123456789', 'adfff@gmail.com', '585 Robertson Drive Bunbury', convert(datetime, '2/6/2019', 103)),
-- 需要完整代码请添加文章底部微信,付费咨询INSERT INTO patients_info
VALUES  -- 需要完整代码请添加文章底部微信,付费咨询-- drugs : dr00000XX
-- devices : de0000XX
INSERT INTO drugs_devices_info
VALUES  -- 需要完整代码请添加文章底部微信,付费咨询INSERT INTO treat_price
VALUES  -- 需要完整代码请添加文章底部微信,付费咨询INSERT INTO appointment
VALUES  -- 需要完整代码请添加文章底部微信,付费咨询INSERT INTO case_history
VALUES  -- 需要完整代码请添加文章底部微信,付费咨询INSERT INTO medical_records
VALUES  -- 需要完整代码请添加文章底部微信,付费咨询INSERT INTO nursing
VALUES  -- 需要完整代码请添加文章底部微信,付费咨询

3. 查询数据


USE MedicalManagementSystem;
GO-- Query 1: Young Doctors
-- SELECT doctor's first name, age, user_type
-- WHERE:
--      age less than 40
-- Order the results by ageSELECT       first_name,age,user_type
FROM        dbo.users_info
WHERE       user_type = 'doctor' ANDage < 40
ORDER BY    age;-- Query 2: The Number of Patients in Each Doctor's Care
-- SELECT doctor's first name, the number of patients,
-- WHERE:
--      the doctor's hire_date in June 2019
-- Order the results by the number of patientsSELECT        u.first_name,p.number
-- 需要完整代码请添加文章底部微信,付费咨询
ORDER BY    p.number;-- Query 3: Drugs Being Used
-- SELECT drug's id, name, specification, quantity, expriry_date and the number of being used
-- WHERE:
--    it was being used in prescription
-- Order the results by the number of being used, in descending orderSELECT         d.d_id,d.name,d.specification,d.quantity,d.expiry_date,m.number
-- 需要完整代码请添加文章底部微信,付费咨询
ORDER BY    m.number DESC;-- Query 4: Appointments and Nurse Care
-- SELECT the patient's name who had an appointment, the whole time of being cared by nurse
-- show all the patients, even if the patient was not being cared by nurse
-- Order by the time of being cared, in descending orderSELECT      a.pt_id,ISNULL(DATEDIFF(hour, n.start_time, n.finish_time), 0) AS care_time
-- 需要完整代码请添加文章底部微信,付费咨询
ORDER BY    care_time DESC;-- Query 5: Patient's Case History and Prescription
-- SELECT patient's id, first name, case history
-- WHERE:
--      the number of sum total drugs and devices that being used to patients more than 1
-- Order by the patient's idSELECT         pa.pt_id,pa.first_name,c.description,c.diagnosis,c.therapy,me.number
-- 需要完整代码请添加文章底部微信,付费咨询
ORDER BY    pa.pt_id;-- Query 6: The Patients Who Was Diagnosed by the Most Expensive Doctor
-- SELECT patient's id, full name, age, gender and doctor's full name,
-- WHERE:
--      the doctor have the most expensive consultation_fee and have been in charge of patients
-- Order the results by patient's idSELECT         p.pt_id,p.first_name + ' ' + p.last_name AS patient_name,p.age,p.gender,u.first_name + ' ' + u.last_name AS doctor_name,t.consultation_fee
-- 需要完整代码请添加文章底部微信,付费咨询
ORDER BY    p.pt_id;-- Query 7: The Three Oldest Patients
-- SELECT the full name, gender, age, the case history and the docotr's full name of the three oldest patients
-- Order the results by patient's age, in descending orderSELECT       TOP (3) p.first_name + ' ' + p.last_name AS patient_name,p.gender,p.age,c.description,c.diagnosis,c.therapy,u.first_name + ' ' + u.last_name AS doctor_name
-- 需要完整代码请添加文章底部微信,付费咨询
ORDER BY    p.age DESC;-- Query 8: Patients With The Same Drug
-- SELECT the full name, gender, age, the case history and drug's name, drug's dosage of patients
-- WHERE:
--      more than 1 people use the same drug
-- Order the results by drug's name ASC, drug's dosage in descending order    SELECT      dr.name AS drug_name,me.quantity AS dosage,pa.first_name + ' ' + pa.last_name AS patient_name,pa.gender,pa.age,ca.description,ca.diagnosis,ca.therapy
-- 需要完整代码请添加文章底部微信,付费咨询
ORDER BY    drug_name ASC, dosage DESC;-- Query 9: Total Cost of Patients
-- SELECT every patient's cost of copay, consultation_fee, drugs, devices, total
--      the cost of copay, consultation_fee are calculated in times
--      and the doctors who are in the patients_info table for one time means one registration and one diagnosis
-- Order the results by total cost, in descending orderSELECT       c.pt_id, t.copay, t.consultation_fee, ISNULL(SUM(m1.quantity * d.selling_price), 0) AS drug_cost, ISNULL(SUM(m2.quantity * d.selling_price), 0) AS device_cost, (t.consultation_fee + t.consultation_fee + ISNULL(SUM(m1.quantity * d.selling_price), 0) + -- 需要完整代码请添加文章底部微信,付费咨询
ORDER BY    total_cost DESC;

4. 创建视图


USE MedicalManagementSystem;
GO-- Patients View
-- Create a view that selects the patient's id, full name, gender, age, description, diagnosis, therapyDROP VIEW IF EXISTS v_patients
GO
CREATE VIEW v_patients AS
SELECT      pa.pt_id,pa.first_name + ' ' + pa.last_name AS patient_name,pa.gender,pa.age,ca.description,ca.diagnosis,ca.therapy
-- 需要完整代码请添加文章底部微信,付费咨询
GO-- Doctors View
-- Create a view that selects the following details:
--      The doctor's id, full name, gender, age, tel, email, hired date
--      The number of patients who were diagnosed by the doctor
--      The total revenue of copay and consultation_fee of the doctorDROP VIEW IF EXISTS v_doctors
GO
CREATE VIEW v_doctors AS
SELECT      u.id,u.first_name + ' ' + u.last_name AS doctor_name,u.gender,u.age,u.tel,u.email,u.hire_date,ISNULL(pa.patients_num, 0) AS patients_num,ISNULL((t.copay + t.consultation_fee) * pa.patients_num, 0) AS total_revenue
-- 需要完整代码请添加文章底部微信,付费咨询
WHERE       u.user_type = 'doctor';
GO

SQL Server医疗信息管理系统数据库【英文版-源码】--(Medical Management System Database)相关推荐

  1. MySQL医疗信息管理系统数据库(源码)

    MySQL医疗信息管理系统数据库(源码) 友情连接 1.学生成绩管理系统数据库设计--MySQL 2.邮件管理数据库设计--MySQL 3.SQL Server医疗信息管理系统数据库[英文版-源码]- ...

  2. SQL Server电影院数据库管理系统【英文版-源码】--(Movie Theatre Management System Database)

    SQL Server电影院数据库管理系统[英文版-源码] 友情连接 1.医疗信息管理系统数据库--MySQL 2.邮件管理数据库设计--MySQL 3.学生成绩管理系统数据库设计--MySQL 4.点 ...

  3. 基于JAVA网上家教信息管理系统计算机毕业设计源码+数据库+lw文档+系统+部署

    基于JAVA网上家教信息管理系统计算机毕业设计源码+数据库+lw文档+系统+部署 基于JAVA网上家教信息管理系统计算机毕业设计源码+数据库+lw文档+系统+部署 本源码技术栈: 项目架构:B/S架构 ...

  4. java计算机毕业设计病人跟踪治疗信息管理系统演示2021源码+数据库+系统+lw文档+部署

    java计算机毕业设计病人跟踪治疗信息管理系统演示2021源码+数据库+系统+lw文档+部署 java计算机毕业设计病人跟踪治疗信息管理系统演示2021源码+数据库+系统+lw文档+部署 本源码技术栈 ...

  5. 基于JAVA罪犯信息管理系统计算机毕业设计源码+系统+数据库+lw文档+部署

    基于JAVA罪犯信息管理系统计算机毕业设计源码+系统+数据库+lw文档+部署 基于JAVA罪犯信息管理系统计算机毕业设计源码+系统+数据库+lw文档+部署 本源码技术栈: 项目架构:B/S架构 开发语 ...

  6. JAVA计算机毕业设计智慧社区信息管理系统开发Mybatis+源码+数据库+lw文档+系统+调试部署

    JAVA计算机毕业设计智慧社区信息管理系统开发Mybatis+源码+数据库+lw文档+系统+调试部署 JAVA计算机毕业设计智慧社区信息管理系统开发Mybatis+源码+数据库+lw文档+系统+调试部 ...

  7. 基于JAVA志愿者信息管理系统计算机毕业设计源码+系统+数据库+lw文档+部署

    基于JAVA志愿者信息管理系统计算机毕业设计源码+系统+数据库+lw文档+部署 基于JAVA志愿者信息管理系统计算机毕业设计源码+系统+数据库+lw文档+部署 本源码技术栈: 项目架构:B/S架构 开 ...

  8. 基于JAVA疫情医疗物资管理系统计算机毕业设计源码+系统+数据库+lw文档+部署

    基于JAVA疫情医疗物资管理系统计算机毕业设计源码+系统+数据库+lw文档+部署 基于JAVA疫情医疗物资管理系统计算机毕业设计源码+系统+数据库+lw文档+部署 本源码技术栈: 项目架构:B/S架构 ...

  9. JAVA计算机毕业设计美容院信息管理系统(附源码、数据库)

    JAVA计算机毕业设计美容院信息管理系统(附源码.数据库) 目运行 环境项配置: Jdk1.8 + Tomcat8.5 + Mysql + HBuilderX(Webstorm也行)+ Eclispe ...

  10. 基于JAVA员工信息管理系统计算机毕业设计源码+系统+数据库+lw文档+部署

    基于JAVA员工信息管理系统计算机毕业设计源码+系统+数据库+lw文档+部署 基于JAVA员工信息管理系统计算机毕业设计源码+系统+数据库+lw文档+部署 本源码技术栈: 项目架构:B/S架构 开发语 ...

最新文章

  1. 固定在计算机主机箱体上,联结计算机各种部件,起桥梁作用的是,2014年12月计算机应用基础模拟试题...
  2. 函数重写 java_java 函数的重载和重写实例代码
  3. openstack 网络简史
  4. altas(ajax)控件(二十三):等级选择控件Rating
  5. SharePoint 2007 SP2 发布
  6. 大厂机密!30 个提升团队研发效能的锦囊
  7. nginx 多php项目配置文件,nginx 配置文件配置多个站点
  8. html5飞机发射教程,Javascript学习笔记(13_5) --js事件(飞机发射子弹)
  9. 苹果appID的获取方法
  10. 大数据分析平台安全的重要性
  11. 搭建自己的博客(二十):优化博客评论功能
  12. exception类型 java_程序员小白入门,Java如何选择异常类型?
  13. 信息技术处理员和计算机二级,信息处理技术员(信息技术处理员含金量)
  14. 关于形而上学与形而下学之区别及关系
  15. [Err] 1418 - This function has none of DETERMINIST
  16. 算法比较——ROC曲线和PR曲线
  17. 分库分表:如何解决数据量大读写缓慢
  18. 单目三维目标检测之CaDDN论文阅读
  19. 《软件开发与创新:ThoughtWorks文集:续集》
  20. A Java Runtime Environment (JRE) or Java Development Kit (JDK)...

热门文章

  1. 定时删除虚拟服务器快照,ESXi6.0 设置自动删除快照脚本及计划任务
  2. Excel数据分类汇总与数据透视表
  3. nginx错误代码说明,出现原因及解决方法
  4. 赵丽颖冯绍峰官宣 | 微博服务器瘫痪!运维:该拿什么拯救我?
  5. 文献记录(part104)--Distance-Based Outlier Detection: Consolidation and Renewed Bearing
  6. MTD/QTD/YTD 去年同期 同比增长——Power BI
  7. mongodb 基本操作:文档查询
  8. 配置Dot1q终结子接口实现跨设备VLAN间通信示例
  9. JavaScript工具类:util.js用法实例
  10. CANoe软件使用(一)——软件界面介绍