Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
37 Cards in this Set
- Front
- Back
The number of participating entities in a relationship is called its _______?
|
degree
|
|
When an entity participates with itself in different roles of a relationship this is called _____? An example is one EMPLOYEE (supervising) another EMPLOYEE
|
Recursive Relationship
|
|
In a binary relationship this specifies the maximum number of relationship instances an entity can participate in.
|
Cardinality Ratios
Can be: 1) 1 to 1 (1:1) 2) 1 to many (1:M) 3) many to 1 (M:1) 4) many to many (M:N) |
|
These specify the minimum number of relationship instances each entity can participate in.
|
Participation constraints
"miinimum cardinality constraint" |
|
This is when ever entity in an entity set must be related to an entity in the other entity set.
Example: WORKS_FOR – every EMPLOYEE must be related to a DEPARTMENT entity via the WORKS_FOR relationship |
Total Participation Constraint
|
|
This is when some entities in an entity set are related to an entity in the other set but it is not required.
Example: MANAGES – only some EMPLOYEE entities are managers for DEPARTMENT entities |
Partial Participation Constraint
|
|
Total Participation constraints are indicated by what?
|
Double lines
|
|
(Relationship attributes) for 1:1 relationships the attributes can be _____?
|
on either side
|
|
(Relationship attributes) For 1:N relationships the attributes can be ____?
|
Only on side of the "many entity" side
|
|
(Relationship attributes) For M:N relationships the attributes are determined by a combination of both entities. These cannot be modeled as part of entity type but rather _____?
|
as part of relationship type
|
|
These are entity types without a key attibute. They are considered to belong to another entity in another set, called the identifying entity type.
|
Weak Entity Types
|
|
In a relational model this is one row of a relation.
|
Tuple
|
|
in a relational model this is one column of a relation.
|
Attribute
|
|
in a relational model this is the who table.
|
Relation
|
|
In a relational model this is all the values that attributes can have.
|
Domain of an Attribute
|
|
This is all the possible values an attribute can take in a relational model. It is atomic and has a specific data type.
|
Domain
|
|
In a relational model this consists of a relation name and a list of attributes. It is a description of what the relation should contain and is denoted by R(A1, A2, ....An). Example: STUDENT(Name, SSN, Address, GPA)
|
Relation Schema
|
|
This is the number of attributes n of its relation schema.
|
Degree (or arity)
|
|
How do you reresent Multivalued attributes in a Relational Model?
|
Must be represented by seperate relations
|
|
How do you represent Composite attributes in a Relational Model?
|
Represented by simple component ttributes in a basic Relational Model
|
|
(Schema-based constraints) What are the 2 key aspects of Domain constraints?
|
1) Data type constraint
2) Each attibute may only take on a value from the domain of that attribute |
|
(Schema-based constraints) what are the 2 key aspects of key constraints?
|
1) Each tuple in a relation must be unique
2) Usually there is a subset of attributes that control uniqueness- this is called a "superkey" |
|
What does it mean to say that Superkeys can have redundant attributes?
|
Example {First_Name, Last_Name, SSN) can be a Superkey but you don't need First_Name and Last_Name as SSN is guaranteed to be unique.
|
|
This is a minimal Superkey. AKA you remove one attribute and it is no longer a superkey.
|
key (note all keys are superkeys but not all superkeys are keys.)
|
|
(Schema-based constraints) Set of relation schemas S = {R1, R2,.... Rm}
|
Relational Database Schema
|
|
(Schema-based constraints) Set of relation states for a relational database such that all integrity constraints are satisfied.
|
Relation Database State
|
|
(Schema-based constraints) No primary key can have a NULL value
|
Entity integrity constraint
|
|
(Schema-based constraints) Specified between two relations. A tuple in one relation that refers to a tuple in a second relation MUST refer to an existing tuble. Uses the concept of a foreign key.
|
Referential Integrity constraint
|
|
Informally, a value in a tuple that points to a primary key in a different tuple.
|
Foreign key
|
|
(Schema-based constraints) These constraints come from outside the basic relationships between tuples. Usually modeled at the application level, but sometimes can be modeled in the database.
|
Semantic Integrity constraints
|
|
What are the two types of operations that a relational model has?
|
1) Retrievals (getting info from db)
2) Updates (adding/changing info in db. Includes: insert, delete, and update) |
|
For Binary 1:1 Relationships If two entities have TOTAL participation in a relationship, then you can turn them into a single entity.
|
Merged Relation Approach
|
|
For Binary 1:1 Relationships Set up a third relation as a lookup table for the relationship.
|
Cross-referenced approach (required for M:N relations)
|
|
For binary 1:N relationships you should use this approach. It identifies which relation represents the entity on "many" side of the relationship. Points to primary key on the "one" side of relationship
|
Foreign Key approach (can also be used for 1:1)
|
|
For Binary M:N Relationships you should use this approach. For Entities E1 and E2 connected by Relationship R, create a rew relation for R. It will include, as attributes, foreign keys pointing at primary keys of E1 and E2 combining into a primary key.
|
Cross-reference approach. You also include any attributes tied to R
|
|
What do you do for multivalued attributes on in ER to Relation model mapping?
|
Create new relation taht has a foreign key pointing at the primary key of initial relation.
|
|
For N-ary Relationships you should use this approach?
|
Cross-reference approach.
|