Quiz 2 Flashcards
The basic concept that the ER model represents is an ____
entity
Entity
Thing or object in the real world with an independent existence
- Can be an object with a physical existence
Attributes
properties that describe entities
Composite Attributes
represent more basic attributes with independent meanings
- Ex: Address can be divided into Street, Address, City, State, Zip
- Can form a hierarchy
Atomic Attributes (simple)
Are not divisible
Single-Valued Attributes
Single-Valued attributes have a single value per entity
- Ex: age
Multivalued Attributes
Multivalued attributes can have multiple values per entity
- Ex: one person can have many college degrees
- can have lower and upper bounds
Derived Attributes
Derived Attributes are derivable from a stored attribute
- Age = Derives
- Date of birth = Stored
Null values
In some cases, a particular entity will not have a value for an attribute
- Ex: some addresses don’t have an apartment number
Complex Attributes
- Arbitrary nesting by grouping components of composite attributes
- Ex: a person can have more than one residence and each residence can have a single address and multiple phones, an attribute Address_phone for a person can be specified - phone and address are composite attributes
Entity type
defines a collection of entities that have similar attributes
- Each type of entity in the database is defined by its name and attributes
- Describes the schema or intension for a set of entities that share the same structure
Entity Set or Entity Collection
The collection of all entities of a particular entity type in the database at any point
- The extension of the entity type - the collection of entities of a particular entity type is grouped into an entity set
Attributes of an Entity Type
- Key or Uniqueness constraint - identifying value
- Specifying that an attribute is a key of an entity type means that the preceding uniqueness property must hold for every entity set of the entity type.
- Entity types can have more than one key attribute
Value Sets (Domains) of Attributes
- Specifies the set of values that may be assigned to that attribute for each individual entity
- Ex: If the range of ages allowed for employees is between 16 and 70, we can specify the value set of the Age attribute of EMPLOYEE to be the set integer numbers between 16 and 70
In ER diagrams, relationship types are displayed as ___ boxes
diamond-shaped
Relationships
- The degree of a relationship type is the number of participating entity types
Role name
Signifies the role that a participating entity from the entity type plays in each relationship instance, and it helps to explain what the relationship means
- Recursive relationships
- Self-referencing relationships
Constraints on Binary Relationship Types
- Relationship types usually have certain constraints that limit the possible combinations of entities that may participate in the corresponding relationship set
- Participation Constraint
- Minimum cardinality constraint
- Total participation (existence dependency)
For a 1:N relationship type, a relationship attribute can be migrated only to the entity type on the ____ of the relationship
N-side
Weak Entity Types
Entity types that do not have key attributes of their own are called weak entity types
- Strong entity types are the opposite
- A weak entity type normally has a partial key, which is the attribute that can uniquely identify weak entities that are related to the same owner entity.
What is the Relational Model?
- A database of relations
- Each relation resembles a table of values or a flat file of records
Formal relational model terminology
Row - tuple
Column header - attribute
Table - relation
The data describing the types of values that can appear in each column by a domain of possible values
Domains
A domain is a set of atomic values
- Assigning data types is specifying a domain
Atomic
Each value in the domain is indivisible as far as the formal relational model is concerned
Attributes
A relation schema2 R, denoted by R(A1, A2, …, An) is made up of a relation name R and a list of attributes, A1, A2, …, An
- Each attribute, Ai, is the name of a role played by some domain, D, in the relation schema, R
The degree of a relation is the
number of attributes n of its relation schema
Attributes and Terms
A relation of degree seven would contain seven attributes
- A relation of a relation schema is a set of n-tuples
- Each n-tuple t is an ordered list of n values
Cardinality
Total number of values in a domain
- We can define a relation as the mathematical relation of degree n on the domains dom(A1), dom(A2), dom(An) which is a subset of the Cartesian product of the domains that define R
Current relation state
reflects only the valid tuples that represent a particular state of the real world
Roles
It is possible for multiple attributes to have the same domain
- The attribute names indicate different roles (interpretations_ for the domain
Relation vs a file or table
Relation is a defined set of tuples that have no particular order
- File records are physically stored on memory so there is always an order
Relational Model Notation
- A relation schema R of degree n is denotes by R(A1, A2, An)
- The uppercase letters Q, R, S denote relation names
- The lowercase letters q,r,s denote relation states
- The letters t, u, v denote tuples
Relational Model Constraints
Inherent model-based constrains (implicit constraints) - these are existing as permanent in the model or as a characteristic attribute
- Schema-based constraints (explicit constraints) - constraints that can be directly expressed in the schemas of the data model, typically by specifying them in the DDL (data definition language)
- Application-based (semantic constraints or business rules) - Constraints that cannot be directly expressed in the schemas of the data model
Data Dependencies (functional and multivalued dependencies)
Used mainly for testing the “goodness: of the design of a relational database and are utilized in a process called normalization
Relational database schema
S is a set of relation schemas and a set of integrity constraints IC