SlideShare a Scribd company logo
Introduction to Computer Science
Databases and SQL
Lecture d
This material (Comp 4 Unit 5) was developed by Oregon Health & Science University, funded by the Department
of Health and Human Services, Office of the National Coordinator for Health Information Technology under
Award Number 90WT0001.
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/.
Databases and SQL
Learning Objectives - 1
• Define and describe the purpose of
databases (Lecture a)
• Define a relational database (Lecture a)
• Describe data modeling and normalization
(Lecture b)
• Describe the structured query language
(SQL) (Lecture c)
2
Databases and SQL
Learning Objectives - 2
• Define the basic data operations for
relational databases and how to
implement them in SQL (Lecture c)
• Design a simple relational database and
create corresponding SQL commands
(Lecture c)
• Examine the structure of a health care
database component (Lecture d)
3
Sample Database Use in VistA
• VistA: Veterans
Health Information
Systems and
Technology
Architecture
• Used at Department
of Veterans Affairs
(VA) health care
facilities Figure 1. VistA screenshot.
(U.S. Dept. of Veterans Affairs, n.d., PD-US)
4
NUMI
• National Utilization Management Integration
(NUMI) supports reviews of clinical care
activities
– Documents patient movements
– Separate from VistA
Figure 2. Stay Movements and Reviews tables in NUMI.
(U.S. Dept. of Veterans Affairs, 2016, PD-US)
5
Workflow
Figure 3. NUMI workflow.
(U.S. Dept. of Veterans Affairs, 2011, PD-US) 6
NUMI Tables
Figure 4. List of tables in NUMI database.
7
Patient Table (Select Elements)
Element Name Data
Type
Primary
Key
Foreign
Key
Comments
PatientID int Yes No ID number for patient
PatientName varchar No No Name that the NUMI system
associates with patient
Sex varchar No No Sex designation associated
with the patient
SSN varchar No No Social Security Number
associated with patient
SiteID smallint Yes Yes ID number for Site
Table 1. Patient table (select elements).
8
Site Table (Select Elements)
Element
Name
Data
Type
Primary
Key
Foreign
Key
Comments
SiteID smallint Yes No ID number for site
SiteName varchar No No Name of site
DisplayName varchar No No Displayed name for site
Table 2. Site table (select elements).
9
ER Diagram
Figure 5. Entity-relationship (ER) Diagram for two tables.
10
Patient Review Table
(Select Elements)
Element Name Data
Type
Primary
Key
Foreign
Key
Comments
PatientReviewID bigint Yes No ID number for Patient Review
PatientID int No Yes ID number for Patient
ReviewDate smalldate
time
No No Date patient was reviewed
UMRAttendingPhysicianID int No Yes ID number for Attending
Physician
PatientStayID bigint No Yes ID number for Patient Stay
CurrentCareLevelID tinyint No Yes ID number for Level of Care
WardLocationID smallint No Yes ID number for Ward Location
Table 3. Patient review table (select elements).
11
ER Diagram
Figure 6. Entity-relationship diagram for seven tables.
12
Patient Review in NUMI
Figure 7. Primary Review screen in NUMI.
(U.S. Dept. of Veterans Affairs, 2011, PD-US) 13
Databases and SQL
Summary – Lecture d
• Viewed an example application: NUMI
• Examined the NUMI database structure
– Tables
– Relationships
14
Databases and SQL
Summary - 1
• Four basic data operations: retrieval,
addition, modification and deletion
• Efficiency of those operations is critical for
efficient use of data
• Information relationships and types are
maintained in a relational database
• Designed a simple database, and
improved it using the normalization
method
15
Databases and SQL
Summary - 2
• Provided introduction to SQL statements
and data types
• Learned basic select, insert, delete, and
update SQL statements
• Examined design of a health care
database
16
Databases and SQL
References – 1 – Lecture d
References
U.S. Department of Veterans Affairs. (2011, September 21). Veterans Health Information
Systems and Technology Architecture.
U.S. Department of Veterans Affairs, Office of Information and Technology. (2011). User
Guide for National Utilization Management Integration (NUMI). (version 1.1.13.1).
U.S. Department of Veterans Affairs, Office of Information and Technology. (2011).
Systems Management Guide for National Utilization Management Integration (NUMI).
(version 1.1.13.1).
Tables
Table 1: Patient Table (select elements). (2011). Public Domain.
Table 2: Site Table (select elements). (2011). Public Domain.
Table 3. Patient review table (select elements). (2011). Public Domain.
Figures
Figure 1: VistA Image. [image on the Internet]. U.S. Department of Veterans Affairs
(n.d.). Retrieved Jan 2012. Available from VistA Imaging Overview
https://www.va.gov/health/imaging/overview.asp at
https://www.va.gov/health/IMAGING/images/CPRS_IMG_comp.png. Public Domain.
17
Databases and SQL
References – 2 – Lecture d
Figures, continued
Figure 2: Stay Movements and Reviews tables in NUMI. [image]. U.S. Department of
Veterans Affairs, Office of Information and Technology. (2016). Figure 43, In User
Guide for National Utilization Management Integration (NUMI). (Version 1.1.14.4).
Retrieved February 27, 2017 from
https://www.va.gov/vdl/documents/HealtheVet/National_Utilization_Management_Inte
gration/numi_user_guide_14_4.docx. Public Domain.
Figure 3: NUMI Workflow. [image]. U.S. Department of Veterans Affairs, Office of
Information and Technology. (2011). In User Guide for National Utilization
Management Integration (NUMI). (Version 1.1.13.1). Public Domain.
Figure 4: List of tables in NUMI database. (2011). Public Domain.
Figure 5: Entity-relationship (ER) Diagram for two tables. (2011). Public Domain.
Figure 6: Entity-relationship diagram for seven tables. (2011). Public Domain.
Figure 7: Primary Review screen in NUMI. [image]. U.S. Department of Veterans Affairs,
Office of Information and Technology. (2011). In User Guide for National Utilization
Management Integration (NUMI). (Version 1.1.13.1). Public Domain.
18
Introduction to Computer Science
Databases and SQL
Lecture d
This material was developed by Oregon
Health & Science University, funded by the
Department of Health and Human Services,
Office of the National Coordinator for Health
Information Technology under Award
Number 90WT0001.
19

More Related Content

PPTX
system-for-diagnosing-health
PPTX
Information Systems - Lecture C
PPT
Hospital Management System
PDF
Umldiagramforhospitalmanagementsystem 140425070951-phpapp02
PPTX
J_McConnell_Westlake Database
DOCX
Hospital database management_system_sql
DOC
Design and implementation of a hospital management system
PPTX
Databases and SQL - Lecture B
system-for-diagnosing-health
Information Systems - Lecture C
Hospital Management System
Umldiagramforhospitalmanagementsystem 140425070951-phpapp02
J_McConnell_Westlake Database
Hospital database management_system_sql
Design and implementation of a hospital management system
Databases and SQL - Lecture B

Similar to Databases and SQL - Lecture D (20)

DOCX
Database Management SystemCase Study
PPT
User-centered Design of a PHR: Traditional Web Forms vs. Wizard Forms [5 Cr2 ...
PDF
Modern Systems Analysis and Design 8th Edition Valacich Test Bank
PPTX
Comp10 unit3a lecture_slides
DOCX
Strengths and Weakness of Informatics.docx
PDF
Modern Systems Analysis and Design 8th Edition Valacich Test Bank
PPTX
National Training on Safe Hospitals - Sri Lanka - Worksheets Module 2 - 14Sep...
PDF
Modern Systems Analysis and Design 8th Edition Valacich Test Bank
PDF
Information Systems Today Managing in the Digital World 6th Edition Valacich ...
PDF
Cal Essay
PPTX
Comp8 unit1a lecture_slides
PPTX
Lecture C
PDF
Oo tech
DOCX
Database design
PDF
Information Systems Today Managing in the Digital World 6th Edition Valacich ...
PDF
IRJET- Data Analysis and Solution Prediction using Elasticsearch in Healt...
PDF
Information Systems Today Managing in the Digital World 6th Edition Valacich ...
PPTX
chapter5_Q&A-.pptx for childers of clas 8
PDF
Search System for Medical Images
PPTX
pentaho_usability_presentation
Database Management SystemCase Study
User-centered Design of a PHR: Traditional Web Forms vs. Wizard Forms [5 Cr2 ...
Modern Systems Analysis and Design 8th Edition Valacich Test Bank
Comp10 unit3a lecture_slides
Strengths and Weakness of Informatics.docx
Modern Systems Analysis and Design 8th Edition Valacich Test Bank
National Training on Safe Hospitals - Sri Lanka - Worksheets Module 2 - 14Sep...
Modern Systems Analysis and Design 8th Edition Valacich Test Bank
Information Systems Today Managing in the Digital World 6th Edition Valacich ...
Cal Essay
Comp8 unit1a lecture_slides
Lecture C
Oo tech
Database design
Information Systems Today Managing in the Digital World 6th Edition Valacich ...
IRJET- Data Analysis and Solution Prediction using Elasticsearch in Healt...
Information Systems Today Managing in the Digital World 6th Edition Valacich ...
chapter5_Q&A-.pptx for childers of clas 8
Search System for Medical Images
pentaho_usability_presentation
Ad

More from CMDLearning (20)

PPT
What is Health Informatics - Lecture B
PPTX
Evolution of and Trends in Health Care - Lecture D
PPTX
Evolution of and Trends in Health Care - Lecture C
PPTX
Evolution of and Trends in Health Care - Lecture B
PPTX
Evolution of and Trends in Health Care - Lecture A
PPTX
Public Healthcare (Part 2) Lecture C
PPTX
Public Healthcare (Part 2) Lecture B
PPTX
Public Healthcare (Part 2) Lecture A
PPTX
Public Health (Part 1) Lecture C
PPTX
Public Health (Part 1) Lecture B
PPTX
Public Health (Part 1) Lecture A
PPTX
Regulating Healthcare - Lecture E
PPTX
Regulating Healthcare - Lecture D
PPTX
Regulating Healthcare - Lecture C
PPTX
Regulating Healthcare - Lecture A
PPTX
Regulating Healthcare - Lecture B
PPTX
Financing Healthcare (Part 2) Lecture C
PPTX
Financing Healthcare (Part 2) Lecture B
PPTX
Financing Healthcare (Part 2) Lecture A
PPTX
Financing Healthcare (Part 2) Lecture D
What is Health Informatics - Lecture B
Evolution of and Trends in Health Care - Lecture D
Evolution of and Trends in Health Care - Lecture C
Evolution of and Trends in Health Care - Lecture B
Evolution of and Trends in Health Care - Lecture A
Public Healthcare (Part 2) Lecture C
Public Healthcare (Part 2) Lecture B
Public Healthcare (Part 2) Lecture A
Public Health (Part 1) Lecture C
Public Health (Part 1) Lecture B
Public Health (Part 1) Lecture A
Regulating Healthcare - Lecture E
Regulating Healthcare - Lecture D
Regulating Healthcare - Lecture C
Regulating Healthcare - Lecture A
Regulating Healthcare - Lecture B
Financing Healthcare (Part 2) Lecture C
Financing Healthcare (Part 2) Lecture B
Financing Healthcare (Part 2) Lecture A
Financing Healthcare (Part 2) Lecture D
Ad

Recently uploaded (20)

PDF
Dr Barbara Knox Shares 5 Child Safety Tips for Healthcare Teams
PPTX
BLADDER CANCER 11.pptx,MEDICAL MANAGEMENT
PPTX
SUPERANTIGENS.pptx evrything covered fully
PDF
MECE & SCQA FRAMEWORKS, - Adding Innovation & Influencing Hospital & Super-Sp...
PPTX
roleof Physiotherapy in obesity management
PPTX
Host Modulation Therapy.pptx by swaroop sony
PPTX
Microbiology, the study of microorganisms, has a rich history marked by key d...
PDF
1 PCM Standard Treatment Guidelines in detailed
PPTX
H&E Staining Procedures | Preparation, Steps, and Troubleshooting
PPTX
Routine Cryptococcal screening & Treatment in CTCs (1).pptx
PPTX
Diaphragmatic Hernia: Understanding the Anatomy, Diagnosis, and Management
PPTX
Skeletal System Presentation by Dr Manasi Kadam
PPT
Lecture 1 - Principles of Protection.ppt
PPTX
Understanding Histopathology: The Art and Science Behind Diagnosis
PPTX
GINA_2025 Guideljne which latest changes
PPTX
Child health services in Bangladesh.pptx
PPTX
Anatomy of female reproductive organs.pptx
PDF
Selvita_Development-Strategy-2022-2025.pdf
PDF
dMOM_Poster_ Maternal and Newborn Health
PDF
Megan Miller Colona Illinois - Passionate About CrossFit
Dr Barbara Knox Shares 5 Child Safety Tips for Healthcare Teams
BLADDER CANCER 11.pptx,MEDICAL MANAGEMENT
SUPERANTIGENS.pptx evrything covered fully
MECE & SCQA FRAMEWORKS, - Adding Innovation & Influencing Hospital & Super-Sp...
roleof Physiotherapy in obesity management
Host Modulation Therapy.pptx by swaroop sony
Microbiology, the study of microorganisms, has a rich history marked by key d...
1 PCM Standard Treatment Guidelines in detailed
H&E Staining Procedures | Preparation, Steps, and Troubleshooting
Routine Cryptococcal screening & Treatment in CTCs (1).pptx
Diaphragmatic Hernia: Understanding the Anatomy, Diagnosis, and Management
Skeletal System Presentation by Dr Manasi Kadam
Lecture 1 - Principles of Protection.ppt
Understanding Histopathology: The Art and Science Behind Diagnosis
GINA_2025 Guideljne which latest changes
Child health services in Bangladesh.pptx
Anatomy of female reproductive organs.pptx
Selvita_Development-Strategy-2022-2025.pdf
dMOM_Poster_ Maternal and Newborn Health
Megan Miller Colona Illinois - Passionate About CrossFit

Databases and SQL - Lecture D

  • 1. Introduction to Computer Science Databases and SQL Lecture d This material (Comp 4 Unit 5) was developed by Oregon Health & Science University, funded by the Department of Health and Human Services, Office of the National Coordinator for Health Information Technology under Award Number 90WT0001. This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/.
  • 2. Databases and SQL Learning Objectives - 1 • Define and describe the purpose of databases (Lecture a) • Define a relational database (Lecture a) • Describe data modeling and normalization (Lecture b) • Describe the structured query language (SQL) (Lecture c) 2
  • 3. Databases and SQL Learning Objectives - 2 • Define the basic data operations for relational databases and how to implement them in SQL (Lecture c) • Design a simple relational database and create corresponding SQL commands (Lecture c) • Examine the structure of a health care database component (Lecture d) 3
  • 4. Sample Database Use in VistA • VistA: Veterans Health Information Systems and Technology Architecture • Used at Department of Veterans Affairs (VA) health care facilities Figure 1. VistA screenshot. (U.S. Dept. of Veterans Affairs, n.d., PD-US) 4
  • 5. NUMI • National Utilization Management Integration (NUMI) supports reviews of clinical care activities – Documents patient movements – Separate from VistA Figure 2. Stay Movements and Reviews tables in NUMI. (U.S. Dept. of Veterans Affairs, 2016, PD-US) 5
  • 6. Workflow Figure 3. NUMI workflow. (U.S. Dept. of Veterans Affairs, 2011, PD-US) 6
  • 7. NUMI Tables Figure 4. List of tables in NUMI database. 7
  • 8. Patient Table (Select Elements) Element Name Data Type Primary Key Foreign Key Comments PatientID int Yes No ID number for patient PatientName varchar No No Name that the NUMI system associates with patient Sex varchar No No Sex designation associated with the patient SSN varchar No No Social Security Number associated with patient SiteID smallint Yes Yes ID number for Site Table 1. Patient table (select elements). 8
  • 9. Site Table (Select Elements) Element Name Data Type Primary Key Foreign Key Comments SiteID smallint Yes No ID number for site SiteName varchar No No Name of site DisplayName varchar No No Displayed name for site Table 2. Site table (select elements). 9
  • 10. ER Diagram Figure 5. Entity-relationship (ER) Diagram for two tables. 10
  • 11. Patient Review Table (Select Elements) Element Name Data Type Primary Key Foreign Key Comments PatientReviewID bigint Yes No ID number for Patient Review PatientID int No Yes ID number for Patient ReviewDate smalldate time No No Date patient was reviewed UMRAttendingPhysicianID int No Yes ID number for Attending Physician PatientStayID bigint No Yes ID number for Patient Stay CurrentCareLevelID tinyint No Yes ID number for Level of Care WardLocationID smallint No Yes ID number for Ward Location Table 3. Patient review table (select elements). 11
  • 12. ER Diagram Figure 6. Entity-relationship diagram for seven tables. 12
  • 13. Patient Review in NUMI Figure 7. Primary Review screen in NUMI. (U.S. Dept. of Veterans Affairs, 2011, PD-US) 13
  • 14. Databases and SQL Summary – Lecture d • Viewed an example application: NUMI • Examined the NUMI database structure – Tables – Relationships 14
  • 15. Databases and SQL Summary - 1 • Four basic data operations: retrieval, addition, modification and deletion • Efficiency of those operations is critical for efficient use of data • Information relationships and types are maintained in a relational database • Designed a simple database, and improved it using the normalization method 15
  • 16. Databases and SQL Summary - 2 • Provided introduction to SQL statements and data types • Learned basic select, insert, delete, and update SQL statements • Examined design of a health care database 16
  • 17. Databases and SQL References – 1 – Lecture d References U.S. Department of Veterans Affairs. (2011, September 21). Veterans Health Information Systems and Technology Architecture. U.S. Department of Veterans Affairs, Office of Information and Technology. (2011). User Guide for National Utilization Management Integration (NUMI). (version 1.1.13.1). U.S. Department of Veterans Affairs, Office of Information and Technology. (2011). Systems Management Guide for National Utilization Management Integration (NUMI). (version 1.1.13.1). Tables Table 1: Patient Table (select elements). (2011). Public Domain. Table 2: Site Table (select elements). (2011). Public Domain. Table 3. Patient review table (select elements). (2011). Public Domain. Figures Figure 1: VistA Image. [image on the Internet]. U.S. Department of Veterans Affairs (n.d.). Retrieved Jan 2012. Available from VistA Imaging Overview https://www.va.gov/health/imaging/overview.asp at https://www.va.gov/health/IMAGING/images/CPRS_IMG_comp.png. Public Domain. 17
  • 18. Databases and SQL References – 2 – Lecture d Figures, continued Figure 2: Stay Movements and Reviews tables in NUMI. [image]. U.S. Department of Veterans Affairs, Office of Information and Technology. (2016). Figure 43, In User Guide for National Utilization Management Integration (NUMI). (Version 1.1.14.4). Retrieved February 27, 2017 from https://www.va.gov/vdl/documents/HealtheVet/National_Utilization_Management_Inte gration/numi_user_guide_14_4.docx. Public Domain. Figure 3: NUMI Workflow. [image]. U.S. Department of Veterans Affairs, Office of Information and Technology. (2011). In User Guide for National Utilization Management Integration (NUMI). (Version 1.1.13.1). Public Domain. Figure 4: List of tables in NUMI database. (2011). Public Domain. Figure 5: Entity-relationship (ER) Diagram for two tables. (2011). Public Domain. Figure 6: Entity-relationship diagram for seven tables. (2011). Public Domain. Figure 7: Primary Review screen in NUMI. [image]. U.S. Department of Veterans Affairs, Office of Information and Technology. (2011). In User Guide for National Utilization Management Integration (NUMI). (Version 1.1.13.1). Public Domain. 18
  • 19. Introduction to Computer Science Databases and SQL Lecture d This material was developed by Oregon Health & Science University, funded by the Department of Health and Human Services, Office of the National Coordinator for Health Information Technology under Award Number 90WT0001. 19

Editor's Notes

  • #2: Welcome to Introduction to Computer Science: Databases and SQL. This is lecture d. The component, Introduction to Computer Science, is a basic overview of computer architecture; data organization, representation and structure; structure of programming languages; networking and data communication. It also includes the basic terminology of computing.
  • #3: The learning objectives for Databases and SQL are to: Define and describe the purpose of databases Define a relational database Describe data modeling and normalization Describe the structured query language, or SQL
  • #4: Define the basic data operations for relational databases and how to implement them in SQL Design a simple relational database and create corresponding SQL commands Examine the structure of a health care database component
  • #5: 4
  • #6: 5
  • #7: 6
  • #8: 7
  • #9: This discussion will begin with the center of the health care system – the patient. Note that for this table, and for all the tables that follow, the examples are from the U.S. Department of Veterans Affairs, or VA, Systems Management Guide for National Utilization Management Integration, or NUMI, written by the architects for system developers and maintainers. To simplify these examples, only a few tables from the NUMI application and only a select number of elements or fields from each table will be presented, which should provide a feel for the database design and relationships without getting lost in too many details. For each table, the column information shows the element, or column name, the data type for the VA database, whether the column is a primary or foreign key, and comments about that element. Each row contains information about this data element in the corresponding table. For the Patient table, there is information for about five of the elements in the table. You can see the VA System Management Guide for details about all fifteen elements. The first element, PatientID, has an int data type. This field is the primary key for the table and represents the ID number for the patient. Note that the element name is in bold as it is the primary key for the table. The next three elements are varchar fields that store the name, sex, and social security number of a patient and are not primary or foreign keys. Sex is often stored as a single character in medical applications, instead of as a varchar. The final field is another integer that stores the ID number for the site. The datatype is referred to as smallint, which is an integer that uses fewer numbers of bits than a regular int. This ID is a primary key and foreign key from the site’s table.
  • #10: This slide shows select elements from the Site table. The SiteID field, which is the primary key for the table, serves as a relationship between the Patient table and the Site table. The other two fields relate to the name of the site--one is the full name and the other is the displayed name for the site in NUMI; this allows for a different variant of the name, for example, an abbreviation, to be displayed within the NUMI application.
  • #11: 10
  • #12: 11
  • #13: 12
  • #14: 13
  • #15: 14
  • #16: 15
  • #17: 16
  • #18: References slide. No audio.
  • #19: References slide. No audio.
  • #20: No audio.