Example: bank and its A TM mac hines. 4. Supp orts - - PDF document

example bank and its a tm mac hines 4 supp orts secure
SMART_READER_LITE
LIVE PREVIEW

Example: bank and its A TM mac hines. 4. Supp orts - - PDF document

What is a Database Managemen t System? 1. Manages v ery large amoun ts of data. 2. Supp orts ecien t access to v ery large amoun ts of data. 3. Supp orts concurren t access to v.l.a.d. Example: bank


slide-1
SLIDE 1 What is a Database Managemen t System? 1. Manages v ery large amoun ts
  • f
data. 2. Supp
  • rts
ecien t access to v ery large amoun ts
  • f
data. 3. Supp
  • rts
concurren t access to v.l.a.d.

Example: bank and its A TM mac hines. 4. Supp
  • rts
secure, atomic access to v.l.a.d.

Con trast t w
  • p
eople editing the same UNIX le | last to write \wins" | with the problem if t w
  • p
eople deduct money from the same accoun t via A TM mac hines at the same time | new balance is wrong whic hev er writes last. 1
slide-2
SLIDE 2 Relational Mo del
  • Based
  • n
tables, as: acct# name balance 12345 Sally 1000.21 34567 Sue 285.48
  • T
  • da
y used in most DBMS's.
  • Amazing
success story
  • f
theoretical ideas tak en to $20B industry .
  • \Big
three" DBMS companies | Oracle, Informix, Sybase | are among the largest soft w are companies in the w
  • rld.

IBM also pla ys, with its DB2 and
  • ther
  • erings.

Microsoft c hallenges in this area to
  • |
c heap DBMS
  • n
the desktop? 2
slide-3
SLIDE 3
  • Relational
companies also c hallenged b y startup \ob ject-orien ted DB" companies.

Conjecture: OODB is
  • v
erblo wn; relational companies will prev ail b ecause they are mo ving rapidly to in tro duce OO concepts as needed via \ob ject-relational " v ersions
  • f
their pro ducts and the SQL3 emerging standard. 3
slide-4
SLIDE 4 Three Asp ects to Studying DBMS's 1. Mo deling and design
  • f
databases. 2. Programming: queries and DB
  • p
erations lik e up date.

SQL = \in tergalacti c datasp eak." 3. DBMS implemen tation. CS145 = (1) + (2), while (3) is co v ered in CS245AB, CS347. 4
slide-5
SLIDE 5 Wh y Study Design? Sk etc h
  • f
structure for database needed, b efore implemen tation (sa y as relations in a relational DBMS).
  • Allo
ws discussion
  • f
issues in simplied terms b efore commiting to implemen tation.
  • Example:
registrar main tains a DB
  • f
courses, studen ts, instructors, etc. What go es in to the DB? What assumptions can w e mak e, e.g., unique instructor for a course? Design Notations En tit y/relationshi p (E/R) and Ob ject Description Language (ODL) will b e co v ered in CS145, and are in common use.
  • F
  • r
eac h there is a semimec hanical w a y to con v ert to relational designs (= sets
  • f
tables). 5
slide-6
SLIDE 6 En tit y/Rel at io nship Mo del
  • Diagrams
similar in spirit to OO mo dels.
  • Entity
lik e
  • b
ject, = \thing."
  • Entity
set lik e class = set
  • f
\similar" en tities/ob ject s.
  • A
ttribute = prop ert y
  • f
en tities in an en tit y set, similar to elds
  • r
\instance v ariables."
  • In
diagrams, en tit y set ! rectangle; attribute !
  • v
al. Studen ts ID name phone heigh t 6
slide-7
SLIDE 7 Relationships
  • Connect
t w
  • r
more en tit y sets.
  • Represen
ted b y diamonds. Studen ts Courses T aking Relationship Set Think
  • f
the \v alue"
  • f
a relationship set as a table.
  • One
column for eac h
  • f
the connected en tit y sets.
  • One
ro w for eac h list
  • f
en tities,
  • ne
from eac h set, that are connected b y the relationship. Studen ts Courses Sally CS145 Sally CS244 Jo e CS145
  • 7
slide-8
SLIDE 8 Multiw a y Relationships Usually binary relationships (connecting t w
  • E.S.)
suce.
  • Ho
w ev er, there are some cases where three
  • r
more E.S. m ust b e connected b y
  • ne
relationship.
  • Example:
relationship among studen ts, courses, T A's. P
  • ssibly
, this E/R diagram is OK: Studen ts Courses T aking Assisting T As 8
slide-9
SLIDE 9
  • W
  • rks
in CS145, b ecause eac h T A is a T A
  • f
all studen ts. Connection studen t-T A is
  • nly
via the course.
  • But
what if studen ts w ere divided in to sections, eac h headed b y a T A?

Then, a studen t in CS145 w
  • uld
b e related to
  • nly
  • ne
  • f
the T A's for CS145. Whic h
  • ne?
  • Need
a 3-w a y relationship to tell. 9
slide-10
SLIDE 10 Studen ts Courses T As Enrolls Studen ts Courses T As Sally CS145 Claire Sue CS145 Ankur Jo e CS145 Claire
  • 10
slide-11
SLIDE 11 A Design Issue: Should Multiw a y Relationships b e Split?
  • Dep
ends
  • n
whether it can b e expressed as indep endent binary relationships.
  • Example:
P aleon tologists Finds F
  • ssils
Sp ecies F
  • ssils
Sp ecies P aleon tologists Lucy A. Afarensis Johansson
  • 11
slide-12
SLIDE 12
  • Here,
OK to split, b ecause sp ecies related
  • nly
to fossil, not to paleon tologist . Sp ecies Of P aleon tologist F
  • und
F
  • ssil
12
slide-13
SLIDE 13 A Design Issue: A ttributes Vs. E.S. + Relationships What is wrong with: F
  • ssils
name sp ecies nder 1. Mak es it imp
  • ssible
to represen t prop erties
  • f
sp ecies (e.g., heigh t and w eigh t
  • f
reference individual )
  • r
nders. 2. Dicult to represen t a set
  • f
nders for a single fossil.

T ec hnically , E/R allo ws sets as the t yp e
  • f
attributes, but it mak es life dicult when w e con v ert E/R to relational DB's, so a v
  • id
sets as attribute t yp es.
  • But
if (1) and (2) are not a problem, e.g., w e don't w an t to represen t attributes
  • f
sp ecies, then E.S. + attributes is simplest and b est. 13
slide-14
SLIDE 14 Can W e Solv e (1) b y Adding A ttributes? F
  • ssils
name sp ecies nder refHeigh t refW eigh t
  • In
tro duces the great problem
  • f
Redundancy.

No w for ev ery fossil
  • f
a sp ecies, w e rep eat the reference heigh t and w eigh t.

W astes space (not so imp
  • rtan
t these da ys).

Oers
  • pp
  • rtunit
y to scr** up, e.g., c hange heigh t in
  • nly
  • ne
fossil among sev eral
  • f
the same sp ecies (will remain imp
  • rtan
t for the foreseeable future). 14