Chapter 3 Flashcards
(47 cards)
Relational database model enables…
Logical representation of the data and its relationships
Logical simplicity yields simple and effective database design methodologies
The logical view is facilitated by the creation of data relationships based on a logical construct called a relation
Characteristics of a relational table (1-4)
- A table is perceived as a 2-D structure composed of rows and columns
- Each table row (tuple) represents a single entity occurrence within the entity set.
- Each table column represents an attribute, and each column has a distinct name.
- Each intersection of a row and a column represents a single data value.
Characteristics of a relational table (5-8)
- All values in a column must conform to the same data format.
- Each column has a specific range of values known as the attribute domain.
- The order of the rows and columns is immaterial to the DBMS.
- Each table must have an attribute or combination of attributes that uniquely identifies each row.
Keys
Consist of one or more attributes that determine other attributes.
-Ensures that each row in a table is uniquely identifiable
-Establish relationships among tables and to ensure the integrity of the data
Primary key (PK)
Attribute or combination of attributes that uniquely identifies a row.
Determination
State in which knowing the value of one attribute makes it possible to determine the value of another.
-Establishes the role of a key
-Based on the relationships among the attributes.
Functional dependence.
The value of one or more attributes determines the value of one or more other attributes.
Determinant (key)
The attribute whose value determines another. Can comprise more than one attribute.
Dependent
Attribute whose value is determined by the other attribute.
Full functional dependence
The entire collection of attributes in the determinant is necessary for the relationship.
Composite Key
Key that is composed of more than one attribute
Key attribute
Attribute that is a part of a key.
Foreign key (FK)
Primary key of one table that has been placed into another table to create a common attribute.
Secondary key
Key used strictly for data retrieval purposes.
Superkey
Key that can uniquely identify any row in the table
Candidate key
Minimal super key (without unnecessary attributes). The PK is the candidate key chosen to uniquely identify a row on a table
Entity integrity
Condition in which each row in the table has its own unique identity
Two requirements of a PK
-All of the values in the primary key must be unique
-No attribute in the primary key can contain a null.
Referential integrity
Every reference to an entity instance by another entity instance is valid
Entity integrity rules
All primary keys must be unique and none can be null.
This is to uniquely identify each row, and then foreign keys can properly reference primary key values.
Referential integrity rules
A foreign key can be null, so long as it is not null in its table’s primary key. It also can be an entry that matches the primary key value in a table to which it is related.
Ways to handle null: Flags
Special codes used to indicate the absence of some value.
Ways to handle nulls: Constraints
NOT NULL Constraint:
-Placed on a column to ensure that every row in the table has a value for that column
-UNIQUE Constraint:
-Restriction placed on a column to ensure that no duplicate values exist for that column.
Relvar (relational operator)
Variable that holds the structure of a relation
-Heading contains the names of the attributes
-Body contains the relations