Introduction to Information and Computer Science Databases and SQL Lecture b This material (Comp4_Unit6b) was developed by Oregon Health & Science University,

Slides:



Advertisements
Similar presentations
Accounting System Design
Advertisements

CSE 190: Internet E-Commerce Lecture 10: Data Tier.
© 2008 Pearson Prentice Hall, Experiencing MIS, David Kroenke
Information Technology in Organizations
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
Chapter 3: Data Modeling
Introduction to Information and Computer Science
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
 An entity-relationship (ER) diagram is a specialized graphic that illustrates the interrelationships between entities in a database.  An Entity Relationship.
Introduction To Databases IDIA 618 Fall 2014 Bridget M. Blodgett.
IST Databases and DBMSs Todd S. Bacastow January 2005.
Dale Roberts 1 Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
Chapter 5 Database Processing.
Using MIS 4e Chapter 5 Database Processing
Database Design Concepts
Chapter 1Oracle9i: SQL1 Chapter 1 Overview of Database Concepts.
Chapter 1 Overview of Database Concepts Oracle 10g: SQL
1 Chapter 1 Overview of Database Concepts. 2 Chapter Objectives Identify the purpose of a database management system (DBMS) Distinguish a field from a.
Principles of Database Design, Part II AIMS 2710 R. Nakatsu.
Concepts and Terminology Introduction to Database.
Component 4/Unit 6f Topic VI: Create simple querying statements for the database The SELECT statement Clauses Functions Joins Subqueries Data manipulation.
Organizing Data and Information AD660 – Databases, Security, and Web Technologies Marcus Goncalves Spring 2013.
CHAPTER 8: MANAGING DATA RESOURCES. File Organization Terms Field: group of characters that represent something Record: group of related fields File:
Lecture 2 An Overview of Relational Database IST 318 – DB Admin.
RELATIONSHIPS Generally there are two main database types: flat-file and relational.
Computer Science 101 Database Concepts. Database Collection of related data Models real world “universe” Reflects changes Specific purposes and audience.
CHAPTER EIGHT Accessing Data Processing Databases.
Component 4: Introduction to Information and Computer Science Unit 6: Databases and SQL Lecture 2 This material was developed by Oregon Health & Science.
Component 4: Introduction to Information and Computer Science Unit 6: Databases and SQL Lecture 4 This material was developed by Oregon Health & Science.
PLUG IT IN 3 Fundamentals of Relational Database Operations.
CHAPTER EIGHT Accessing Data Processing Databases.
SQL Structured Query Language Programming Course.
Lecturer: Gareth Jones. How does a relational database organise data? What are the principles of a database management system? What are the principal.
Introduction to Information and Computer Science Computer Programming Lecture b This material (Comp4_Unit5b), was developed by Oregon Health and Science.
Introduction to Databases Trisha Cummings. What is a database? A database is a tool for collecting and organizing information. Databases can store information.
Chapter 4 Database Processing Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall 4-1.
Entity-Relationship Modeling Based on Chapter 12.
Chapter 1Introduction to Oracle9i: SQL1 Chapter 1 Overview of Database Concepts.
Component 4: Introduction to Information and Computer Science Unit 6: Databases and SQL Lecture 3 This material was developed by Oregon Health & Science.
Component 4: Introduction to Information and Computer Science Unit 9: Components and Development of Large Scale Systems Lecture 3 This material was developed.
1 CSE 2337 Introduction to Data Management Textbook: Chapter 1.
Component 4: Introduction to Information and Computer Science Unit 6a Databases and SQL.
Component 4/Unit 6b Topic II Relational Databases Keys and relationships Data modeling Database acquisition Database Management System (DBMS) Database.
ENTITY RELATIONSHIP DIAGRAM ENTITY RELATIONSHIP DIAGRAM IS A SPECIALIZED GRAPHIC THAT ILLUSTRATES THE INTERRELATIONSHIPS BETWEEN ENTITIES IN A DATABASE.
Relational Theory and Design
Component 4: Introduction to Information and Computer Science Unit 5: Overview of Programming Languages, Including Basic Programming Concepts Lecture 2.
Lesson 2: Designing a Database and Creating Tables.
Introduction to Information and Computer Science
(C) 2000, The University of Michigan 1 Database Application Design Handout #2 January 14, 2000.
BSA206 Database Management Systems Lecture 2: Introduction to Oracle / Overview of Database Concepts.
CTFS Workshop Shameema Esufali Asian data coordinator and technical resource for the network
Copyright © 2013 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin APPENDIX C DESIGNING DATABASES APPENDIX C DESIGNING DATABASES.
Entity-Relationship Diagram Presentation Gianna-lee Williams 6AQ Ms. Anderson.
Understand Relational Database Management Systems Software Development Fundamentals LESSON 6.1.
Component 4: Introduction to Information and Computer Science Unit 6: Databases and SQL Lecture 6 This material was developed by Oregon Health & Science.
Database: SQL, MySQL, LINQ and Java DB © by Pearson Education, Inc. All Rights Reserved.
Component 10 – Fundamentals of Health Workflow Process Analysis and Redesign Unit 3-6 – Process Mapping Entity-Relationship Diagrams This material was.
Microsoft Access 2010 Chapter 11 Database Design.
Introduction to Information and Computer Science Databases and SQL Lecture d This material (Comp4_Unit6d) was developed by Oregon Health & Science University,
Hoi Le. Why database? Spreadsheet is not good to: Store very large information Efficiently update data Use in multi-user mode Hoi Le2.
Lecture 5 Data Model Design Jeffery S. Horsburgh Hydroinformatics Fall 2012 This work was funded by National Science Foundation Grant EPS
Rationale Databases are an integral part of an organization. Aspiring Database Developers should be able to efficiently design and implement databases.
1 CS122A: Introduction to Data Management Lecture #4 (E-R  Relational Translation) Instructor: Chen Li.
IT 5433 LM3 Relational Data Model. Learning Objectives: List the 5 properties of relations List the properties of a candidate key, primary key and foreign.
Copyright © 2014 Pearson Canada Inc. 5-1 Copyright © 2014 Pearson Canada Inc. Application Extension 5a Database Design Part 2: Using Information Technology.
Application Extension 5a
Introduction to Computer Science
Chapter 4 Relational Databases
Information Systems for Health:
Presentation transcript:

Introduction to Information and Computer Science Databases and SQL Lecture b This material (Comp4_Unit6b) 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 IU24OC

Databases and SQL Learning Objectives 2 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) 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 healthcare database component (Lecture d) Health IT Workforce Curriculum Version 3.0/Spring 2012 Introduction to Information and Computer Science Databases and SQL Lecture b

Representing Data Identify entities (tables) Identify attributes (columns) Identify table relationships 6.8 Figure: Entity-Relationship Diagram (ER diagram) (PD-US, 2012) 3 Health IT Workforce Curriculum Version 3.0/Spring 2012 Introduction to Information and Computer Science Databases and SQL Lecture b

Relationships One-to-one One-to-many Many-to-many 4 Health IT Workforce Curriculum Version 3.0/Spring 2012 Introduction to Information and Computer Science Databases and SQL Lecture b 6.9 Figure: One-to-many relationship (PD-US, 2012)

Identify the Data A contact: –Person’s first name –Person’s last name –Company name –Company address –Company city –Company state 5 Health IT Workforce Curriculum Version 3.0/Spring 2012 Introduction to Information and Computer Science Databases and SQL Lecture b

Simple Database Structure One entity/table Create a unique row identifier Attributes: –Key (integer) –Person’s first name (varchar) –Person’s last name (varchar) –Company name (varchar) –Company address (varchar) –Company city (varchar) –Company state (char) 6.10 Table: Contact attributes (PD-US, 2012) 6 Health IT Workforce Curriculum Version 3.0/Spring 2012 Introduction to Information and Computer Science Databases and SQL Lecture b Contact Key PersonFirstName PersonLastName CoName CoAddress CoCity CoState

Contact Table Key PersonFirst Name PersonLast Name CoNameCoAddressCoCityCoState 1BillRobesonCommunity Hospital, Inc MainPortlandOR 2AlbertBrookingsCommunity Hospital Inc Main St.PortlandOR 6.11 Table: Contact table (PD-US, 2012) Problems: –Company data is stored in multiple locations –Company data may be inconsistent –Significant work to update data when company information changes 7 Health IT Workforce Curriculum Version 3.0/Spring 2012 Introduction to Information and Computer Science Databases and SQL Lecture b

Database Normalization Prevent data inconsistency Prevent update errors Eliminate data redundancy 8 Health IT Workforce Curriculum Version 3.0/Spring 2012 Introduction to Information and Computer Science Databases and SQL Lecture b

Normalized Database Structure Two tables: Person and Company Each has a unique row identifier – a primary key Need to link the company to the contact 6.12 Figure: Normalized database structure (PD-US, 2012) 9 Health IT Workforce Curriculum Version 3.0/Spring 2012 Introduction to Information and Computer Science Databases and SQL Lecture b

New Tables Person Table ContactKeyFirstNameLastNameCompanyKey 1BillRobeson1 2AlbertBrookings Tables: New tables using same data from Table 6.5 (PD-US, 2012) 10 Health IT Workforce Curriculum Version 3.0/Spring 2012 Introduction to Information and Computer Science Databases and SQL Lecture b Company Table Company Key NameAddressCityState 1Community Hospital, Inc MainPortlandOR

How Do We Do This? Database Management System –Create –Maintain –Use Many available (NOT an exhaustive list) –Oracle –Microsoft SQL Server –IBM DB2 –MySQL –PostgreSQL 11 Health IT Workforce Curriculum Version 3.0/Spring 2012 Introduction to Information and Computer Science Databases and SQL Lecture b

Building a Database Database Management System Tools –Create tables –Create relationships –Control access –More… Structured Query Language (SQL) –Database management –Access to data 12 Health IT Workforce Curriculum Version 3.0/Spring 2012 Introduction to Information and Computer Science Databases and SQL Lecture b

Databases and SQL Summary – Lecture b Databases can be modeled using entity relationship diagrams Relationships can have 3 different types of cardinality Normalization avoids duplicate data Relationships are created using foreign keys 13 Health IT Workforce Curriculum Version 3.0/Spring 2012 Introduction to Information and Computer Science Databases and SQL Lecture b

Databases and SQL References – Lecture b References Chen, P. P.-S. (1976). The Entity-Relationship Model - Toward a Unified View of Data. ACM Transactions on Database Systems, 1(1). International Organization for Standardization. (2008). Information technology -- Database languages -- SQL (No. ISO/IEC 9075-(1-4,9-11,13,14)). Kent, W. (1983). A simple guide to five normal forms in relational database theory. Communications of the ACM, 26(2). 14 Health IT Workforce Curriculum Version 3.0/Spring 2012 Introduction to Information and Computer Science Databases and SQL Lecture b Charts, Tables, Figures 6.8 Figure: Entity-Relationship Diagram (ER diagram) (PD-US, 2012) 6.9 Figure: One-to-many relationship (PD-US, 2012) 6.10 Table: Contact attributes (PD-US, 2012) 6.11 Table: Contact table (PD-US, 2012) 6.12 Figure: Normalized database structure (PD-US, 2012) 6.13 Tables: New tables using same data from Table 6.5 (PD-US, 2012)