This document discusses key concepts related to database relationships including relations, functions, and graphs. It defines a relation as an association between data items, and a relational database as using rules to define relationships between data. An n-ary relationship associates multiple elements within each data set. A function requires a unique mapping between domain and range. A graph uses vertices and edges to visually depict relationships between set elements. Examples are provided to illustrate these concepts related to video game data.
1 of 11
Download to read offline
More Related Content
Phase 2 task 2 - schwappach
1. NOTE: You will need to view speakers notes for a detailed explanation of the slide topics
Please Use MS Power Point version 2007 for full compatibility with slide.
2. What are Relations?:
A relation is an association or connection from
one item or object to another.
The item or object could be a number, value,
or word.
A database can be envisioned as a central
storage center for massive collections of data.
A relational database uses structured rules to
define and maintain critical relationships
between data.
See speakers notes for detailed explanation with examples.
3. Example of a Relationship:
The three games below have been assigned relationships
defined above and are listed in ordered sets.
This is an example of an n-ary relationship (explained later),
and also fulfills the requirements for a function (explained
later).
Genre Title Year Fun Factor
Relationship
Relationship
RPG Final Fantasy IV 1991 10
Legend of
Adventure 1986 10
Zelda
RPG Final Fantasy VII 1997 10
See speakers notes for detailed explanation with examples.
4. N-ary and Binary Relations:
In a binary relationship there is a one element to one
element limit between two objects in a set.
For example, if you were to take your list of video games
and only associate video game names with video game
genres you would have a binary relationship.
Discrete Mathematics, seventh edition states The bi in a
binary relation R refers to the fact that R has two columns
when we write R as a table. (Johnsonbaugh, 2009)
In an n-ary relationship there are many elements associated
within each set. This relation is best visualized as a table with n-
tuple columns.
See speakers notes for detailed explanation with examples.
5.
Binary Relationship Title Genre
Final Fantasy IV RPG
Final Fantasy VII Adventure
Legend of Zelda RPG
Title Genre Year Fun Factor
N-ary Relationship
Final
RPG 1991 10
Fantasy IV
Legend of
Adventure 1986 10
Zelda
Final
RPG 1997 10
Fantasy VII
See speakers notes for detailed explanation with examples.
6. What is a Function?:
CTU defines a function as a relation between objects
that requires a unique and distinct mapping for each
object in question. (Colorado Technical University, 2008)
Elizabeth Stapel breaks this idea down further by saying,
A function is a well-behaved relation. Just as with
members of your own family, some members of the
relation family are better behaved than other. (This means
that, while all functions are relations, since they pair
information, not all relations are functions. Functions are a
sub-classification of relations.) (Stapel, 2007)
See speakers notes for detailed explanation with examples.
7. Example of a Function:
Using the video game example from relations on previous slide, so
long as each element in the set relates solely to another element (A
game can be either an RPG or an Adventure, but it cannot both), it
fulfills the requirement of a function.
If the game was an Adventure and RPG these rules would break
down and it would no longer be a function.
Domain Range
Not a Function
Domain Range
Function
Final Fantasy IV RPG
Final Fantasy IV RPG
Final Fantasy VII Adventure
Final Fantasy VII Adventure
Legend of Zelda
Legend of Zelda Final
Fantasy
Adventure
See speakers notes for detailed explanation with examples.
8. What is a Graph?:
Graphs provide a visual means for describing the relationships
between elements of a set. There are many types of graphs, but
since we are learning about database relationships
According to Eric Weisstein, In a mathematician's terminology, a
graph is a collection of points and lines connecting some (possibly
empty) subset of them. The points of a graph are most commonly
known as graph vertices, but may also be called "nodes" or simply
"points." Similarly, the lines connecting the vertices of a graph are
most commonly known as graph edges, but may also be called "arcs"
or "lines." (Weisstein, 2008)
See speakers notes for detailed explanation with examples.
9. Example:
In the graph below illustrates the vertices (nodes) and edges of a graph.
Key
= Nodes
= Edges
Application:
As an application and example to relational databases, each vertex could be used to
portray one object and edges can be used to portray relationships. See next 際際滷.
See speakers notes for detailed explanation with examples.
10. Applied Example:
The graph below illustrates the relationships between games, given from our
earlier table.
See speakers notes for detailed explanation with examples.