










Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Notes; Class: Database Systems I; Subject: Computer Science; University: University of Alabama - Birmingham; Term: Fall 2001;
Typology: Study notes
1 / 18
This page cannot be seen from the preview
Don't miss anything!











What is a Database Management System?
F Example: bank and its ATM machines.
F Contrast two p eople editing the same UNIX le | last to write \wins" | with the problem if two p eople deduct money from the same account via ATM machines at the same time | new balance is wrong whichever writes last.
Relational Mo del
Based on tables, as:
acct# name balance 12345 Sally 1000. 34567 Sue 285.
To day used in most DBMS's.
Three Asp ects to Studying DBMS's
F Allows exploration of issues b efore committing to an implementation.
CS145 = (1) + (2), while (3) is covered in CS245, CS346, CS347.
Entity/Rel at io nship Mo del
Diagrams to represent designs.
Entity like ob ject, = \thing."
Entity set like class = set of \similar" entities/ob ject s.
Attribute = prop erty of entities in an entity set, similar to elds of a struct.
In diagrams, entity set! rectangle; attribute ! oval.
Students
ID name phone
height
Multiway Relationships
Usually binary relationships (connecting two E.S.) suce.
However, there are some cases where three or more E.S. must b e connected by one relationship.
Example: relationship among students, courses, TA's. Possibly, this E/R diagram is OK:
Students Taking Courses
Assisting
TAs
Works in CS145, b ecause each TA is a TA of all students. Connection student-TA is only via the course.
But what if students were divided into sections, each headed by a TA? F Then, a student in CS145 would b e related to only one of the TA's for CS145. Which one?
Need a 3-way relationship to tell.
Beers-Bars-Drinkers Example
Our running example for the course.
Serves Frequents
Likes
Bars
Beers Drinkers
name addr license
name manf name addr
Multiplicity of Relationship s
Many-many Many-one One-one
Representatio n of Many-One
E/R: arrow p ointing to \one." F Rounded arrow = \exactly one."
One-One Relationshi ps
Put arrows in b oth directions.
Beers seller
Manfs Best-
Design Issue:
Is the rounded arrow justi ed?
Design Issue:
Here, manufacturer is an E.S.; in earlier diagrams it is an attribute. Which is right?
Attributes on Relationshi ps
Beers
price
Bars Sells
Shorthand for 3-way relationship:
Bars Sells Beers
price
Prices
Converting Multiway to 2-Way
Baro que in E/R, but necessary in certain \ob ject-oriented" mo dels.
Create a new connecting E.S. to represent rows of a relationship set. F E.g., (Jo e's Bar, Bud, $2.50) for the Sel ls relationship.
Many-one relationships from the connecting E.S. to the others.
Bars Beers
The- Beer
Prices
Bar
The- The- Price
Roles
Sometimes an E.S. participates more than once in a relationship.
Lab el edges with roles to distinguish.
Married
Drinkers
husband wife
Husband Wife d 1 d 2 d 3 d 4