0% found this document useful (0 votes)
5 views38 pages

Lecture3 Database Part1

Uploaded by

nhwysnhi
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views38 pages

Lecture3 Database Part1

Uploaded by

nhwysnhi
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

INTERNAIONAL UNIVERSITY – VNU HCMC

SCHOOL OF BIOMEDICAL ENGINEERING

Information Technology in the


Healthcare System

Dr. Tran Le Giang


Spring 2022
Information Technology in the Healthcare System School of Biomedical Engineering – International University – VNU HCMC
Information Technology in the Healthcare System School of Biomedical Engineering – International University – VNU HCMC

The documents to be handled with a patient


Information Technology in the Healthcare System School of Biomedical Engineering – International University – VNU HCMC

Documents storage in a hoptial


Information Technology in the Healthcare System School of Biomedical Engineering – International University – VNU HCMC

Problems with Storing Data in Files

qData stored in different files cannot be easily related.


qAccessing desired records may not be easy.
qEfficient protection against inconsistency caused by multiple
concurrent users not easy to implement.
qEffective crash recovery not supported.
qSecurity and access control not enough.
Information Technology in the Healthcare System School of Biomedical Engineering – International University – VNU HCMC

A Client/Database System
Information Technology in the Healthcare System School of Biomedical Engineering – International University – VNU HCMC

The three hardware components of a client/server system


q Clients
q Server
q Network

Terms to know about client/server systems


q Local area network (LAN)
q Wide area network (WAN)
q Enterprise system
Information Technology in the Healthcare System School of Biomedical Engineering – International University – VNU HCMC

A Simple Web-Based System


Information Technology in the Healthcare System School of Biomedical Engineering – International University – VNU HCMC

qData is the presentation of objects and events and data is stored in


computer storage
qData has structure: number, date, character, ..
qData doesn’t have a structure: image, speech, movies….
qA database is an integrated collections of data.
Information Technology in the Healthcare System School of Biomedical Engineering – International University – VNU HCMC

First database release Primary platforms


q Oracle 1979 q Oracle – Unix, OS/390 and z/OS
q DB2 1985 q DB2 – Unix, OS/390 and z/OS
q SQL Server 1987 q SQL Server – Windows
q MySQL 2000 q MySQL – Unix, Windows, Mac OS
Information Technology in the Healthcare System School of Biomedical Engineering – International University – VNU HCMC

Database vs DBMS

qA database is an integrated collection of data.


qA database management system (DBMS) is a software package
designed to create and manage a database.
qThe data stored in a database are organized according to the data
model supported by the DBMS.
qA relational database, for example, stores the data in a collection of
tables.
qExample of DBMS: SQL server, MySQL, Oracle,…
Information Technology in the Healthcare System School of Biomedical Engineering – International University – VNU HCMC

DBMS Functions

qData independence and efficient access.


qReduced application development time.
qData integrity and security. Different users may access different data
subsets.
qUniform data administration.
qConcurrent access, recovery from crashes.
Information Technology in the Healthcare System School of Biomedical Engineering – International University – VNU HCMC

Data Model

qA data model is a collection of concepts for describing data.

qThe relational model of data is the most widely used data model today.
qMain concept: relation, basically a table with rows and columns.
qRelations can represent entities with attributes and associations among entities.
Information Technology in the Healthcare System School of Biomedical Engineering – International University – VNU HCMC

Example: Student Relation

qStudent (sid: string, name: string, login: string, age: integer, gpa: real)
Information Technology in the Healthcare System School of Biomedical Engineering – International University – VNU HCMC

Entity-Relationship Model
Information Technology in the Healthcare System School of Biomedical Engineering – International University – VNU HCMC

Describe Data: ER Model

qThe data model of the DBMS hides details - Semantic Models assist in
the DB design process.
qSemantic Models allow an initial description of data in the “real world”.
qA DBMS do not support directly all the features in a semantic model.
qMost widely used: Entity-Relationship model (E/R).
Information Technology in the Healthcare System School of Biomedical Engineering – International University – VNU HCMC

Overview of Database Design


qConceptual design: (ER Model is used at this stage.)
§ What are the entities and relationships in the enterprise?

§ What information about these entities and relationships should we store in the
database?

§ What are the integrity constraints or business rules that hold?

§ A database `schema’ in the ER Model can be represented pictorially (ER


diagrams).

§ Can map an ER diagram into a relational schema.


Information Technology in the Healthcare System School of Biomedical Engineering – International University – VNU HCMC

Database Modeling and Implementation Process

Relational DBMS
Idea ER Design Relational model
Implementation
Information Technology in the Healthcare System School of Biomedical Engineering – International University – VNU HCMC

Purpose of E/R Model

qThe E/R model allows us to sketch database schema designs.


§ Includes some constraints, but not operations.

§ Designs are pictures called entity-relationship diagrams.

§ Later: convert E/R designs to relational DB designs.


Information Technology in the Healthcare System School of Biomedical Engineering – International University – VNU HCMC

Entity Sets

qEntity = “thing” or object.


qEntity set = collection of similar entities.
§ Similar to a class in object-oriented languages.

qAttribute = property of (the entities of) an entity set.


§ Attributes are simple values, e.g. integers or character
strings, not structs, sets, etc.
Information Technology in the Healthcare System School of Biomedical Engineering – International University – VNU HCMC

E/R Diagrams

qIn an entity-relationship diagram:


§ Entity set = rectangle.

§ Attribute = oval, with a line to the rectangle representing its entity set.

Entity set Attribute


Information Technology in the Healthcare System School of Biomedical Engineering – International University – VNU HCMC

Manf Name

Beer

qEntity set Beers has two attributes, name and manf (manufacturer).
qEach Beers entity has values for these two attributes, e.g. (Bud,
Anheuser-Busch)
Information Technology in the Healthcare System School of Biomedical Engineering – International University – VNU HCMC

Relationship

qA relationship connects two or more entity sets.


qIt is represented by a diamond, with lines to each of the entity sets
involved.

Relationship
Information Technology in the Healthcare System School of Biomedical Engineering – International University – VNU HCMC

Manf
Addr Name

License Bar Sells Beer Name

Visits Likes

Drinker

Addr Name
Information Technology in the Healthcare System School of Biomedical Engineering – International University – VNU HCMC

Relationship Set

qThe current “value” of an entity set is the set of entities that belong to it.
qExample: the set of all bars in our database.
qThe “value” of a relationship is a relationship set, a set of tuples with one
component for each related entity set.
Information Technology in the Healthcare System School of Biomedical Engineering – International University – VNU HCMC

Example: Relationship Set

qFor the relationship Sells, we might have a relationship set like:

Bar Beer
Joe’s Bar Bud
Joe’s Bar Miller
Sue’s Bar Bud
Sue’s Bar Pete’s Ale
Sue’s Bar Bud Lite
Information Technology in the Healthcare System School of Biomedical Engineering – International University – VNU HCMC

Multiway Relationships

qSometimes, we need a relationship that connects more than two


entity sets.
qSuppose that drinkers will only drink certain beers at certain bars.
§ Our three binary relationships Likes, Sells, and Frequents do not allow us to
make this distinction.

§ But a 3-way relationship would.


Information Technology in the Healthcare System School of Biomedical Engineering – International University – VNU HCMC

Manf
Addr Name

License Bar Beer Name

Preferences

Drinker

Addr Name
Information Technology in the Healthcare System School of Biomedical Engineering – International University – VNU HCMC

A Typical Relationship Set

Bar Drinker Beer


Joe’s Bar Ann Miller
Sue’s Bar Ann Bud
Sue’s Bar Ann Pete’s Ale
Joe’s Bar Bob Bud
Joe’s Bar Bob Miller
Joe’s Bar Cal Miller
Sue’s Bar Cal Bud Lite
Information Technology in the Healthcare System School of Biomedical Engineering – International University – VNU HCMC

qMany-Many Relationships

qFocus: binary relationships, such as Sells


between Bars and Beers.
qIn a many-many relationship, an entity of
either set can be connected to many entities
of the other set.
§ E.g., a bar sells many beers; a beer is sold by many
bars.
Information Technology in the Healthcare System School of Biomedical Engineering – International University – VNU HCMC

Many-One Relationships

qSome binary relationships are many -one from one


entity set to another.
qEach entity of the first set is connected to at most
one entity of the second set.
qBut an entity of the second set can be connected to
zero, one, or many entities of the first set.
Information Technology in the Healthcare System School of Biomedical Engineering – International University – VNU HCMC

One-One Relationships

qIn a one-one relationship, each entity of either entity


set is related to at most one entity of the other set.
§ Example: Relationship Best-seller between entity sets
Manfs (manufacturer) and Beers.

qA beer cannot be made by more than one


manufacturer, and no manufacturer can have more
than one best-seller (assume no ties).
Information Technology in the Healthcare System School of Biomedical Engineering – International University – VNU HCMC

Example
qA user can study many courses
qA course can have many users

n m
User Studies Course
Information Technology in the Healthcare System School of Biomedical Engineering – International University – VNU HCMC

Example
qA user can teach many courses
qA course can only have a teacher

n m
User Studies Course

m
1

Teaches
Information Technology in the Healthcare System School of Biomedical Engineering – International University – VNU HCMC

Title
n
Views Lecture
Duration
m

Has
ID
Title
m 1
n m
Name User Preferences Course Description

1 m
Category
Email

Teaches
Information Technology in the Healthcare System School of Biomedical Engineering – International University – VNU HCMC

Relational Model
Information Technology in the Healthcare System School of Biomedical Engineering – International University – VNU HCMC
Information Technology in the Healthcare System School of Biomedical Engineering – International University – VNU HCMC

q Informally, a relation looks like a table of values.

q A relation typically contains a set of rows.


q The data elements in each row represent certain facts that correspond to a
real-world entity or relationship
q In the formal model, rows are called tuples

q Each column has a column header that gives an indication of the meaning of
the data items in that column
q In the formal model, the column header is called an attribute name (or just attribute)

You might also like