Cis 3060 Chapter 3

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

CHARACTERISTICS OF A RELATIONAL TABLE

1 A table is perceived as a two-dimensional structure composed of rows and columns. 2 Each table row (tuple) represents a single entity occurrence within the entity set. 3 Each table column represents an attribute, and each column has a distinct name. 4 Each intersection of a row and column represents a single data value. 5 All values in a column must conform to the same data format. 6 Each column has a specific range of values known as the attribute domain. 7 The order of the rows and columns is immaterial to the DBMS. 8 Each table must have an attribute or combination of attributes that uniquely identifies each row.

Data dictionary

A DBMS component that stores metadata— data about data. Thus, the data dictionary contains the data definition as well as their characteristics and relationships. A data dictionary may also include data that are external to the DBMS. Also known as an information resource dictionary. See also active data dictionary, metadata, and passive data dictionary.

Referntial Intergrity

A condition by which a dependent table's foreign key must have either a null entry or a matching entry in the related table.

Full functional dependence

A condition in which an attribute is functionally dependent on a composite key but not on any subset of the key.

System catalog

A detailed system data dictionary that describes all objects in a database.

Inner join

A join operation in which only rows that meet a given criterion are selected. The join criterion can be an equality condition (natural join or equijoin) or an inequality condition (theta join). The inner join is the most commonly used type of join. Contrast with outer join.

Theta join

A join operator that links tables using an inequality comparison operator (<, >, <=, >=) in the join condition.

Equijoin

A join operator that links tables based on an equality condition that compares specified columns of the tables.

Secondary key

A key used strictly for data retrieval purposes. For example, customers are not likely to know their customer number (primary key), but the combination of last name, first name, middle initial, and telephone number will probably match the appropriate table row. See key.

Candidate key

A minimal superkey; that is, a key that does not contain subset of attributes that is itself a superkey.

Composite key

A multiple-attribute key.

Set theory

A part mathematical science that deals with sets, or groups of things, and is used as the basis for data manipulation in the relational model.

Closure

A property of relational operators that permits the use of relational algebra operators on existing tables (relations) to produce new relations.

Outer join

A relational algebra join operation that produces a table in which all unmatched pairs are retained; unmatched values in the related table are left null. Contrast with inner join. See also left outer join and right outer join.

Natural join

A relational operation that yields a new table composed of only rows with common values in their common attribute(s).

Relational Algebra

A set of mathematical principles that form the basis for manipulating relational table contents; the eight main functions are SELECT, PROJECT, JOIN, INTERSECT, UNION, DIFFERENCE, PRODUCT, and DIVIDE.

Foreign key (FK)

An attribute or attributes in on table whose values must match the primary key in another table or whose values must be null. See key.

Dependent

An attribute whose value is determined by another attribute.

Composite entity

An entity designed to transform an M:N relationship into two 1:M relationships. The composite entity's primary key comprises at least the primary keys of the entities that it connects. Also known as a bridge entity or associative entity. See also linking table.

Unique index

An index in which the index key can only associated pointer value (row).

Determinant

Any attribute in a specific row whose value directly determines other values in that row. Boyce-Codd normal form (BCNF).

Join columns

Columns that are used in the criteria of join operations. The join columns generally share similar values.

Right outer join

In a pair of tables to be joined, a join that yields all of the rows in the right table, including the ones with no matching values in the other table. For example, a right outer join of CUSTOMER with AGENT will yield all of the AGENT rows, including the ones that do not have a matching CUSTOMER row. See also left outer join and outer join.

Left outer join

In a pair of tables to be joined, a join that yields all the rows in the left table, including those that have no matching values in the other table. For example, a left outer join of CUSTOMER with AGENT will yield all of the CUSTOMER rows, including the ones that do not have a matching AGENT row. See also outer join and right outer join.

Domain

In data modeling the construct used to organize and describe an attribute's set of possible values.

Intersect

In relation algebra, an operator used to yield only the rows that are common to two union-compatible tables.

Join

In relational algebra, a type of operator used to yield tows from two tables based on criteria. There are many types of jin, theta join, equijoin and outer join.

Project

In relational algebra, an operator used to select a subset of columns.

Divide

In relational algebra, an operator that answers queries about one set of data being associated with all values of data in another set of data.

Union

In relational algebra, an operator used to merge (append) two tables into a new table, dropping the duplicate rows. The tables must be union-compatible.

Select

In relational algebra, an operator used to select a subset of rows. See restrict.

Product

In relational algebra, an operator used to yield all possible pairs of rows from two tables. Also known as the Cartesian product.

Difference

In relational algebra, an operator used to yield all rows from one table that are not found in another union-compatible table.

Tuple

In the relational model, a table row.

Linking table

In the relational model, a table that implements an M:M relationship. See also composite entity.

Primary key (PK)

In the relational model, an identifier composed of one or more attributes that uniquely identifies a row. Also, a candidate key selected as unique entity identifier. See key.

Functional dependence

Within a relation R, an attribute B is functionally dependent on an attribute A if and only if a given value of attribute A determines exactly one value of attribute B. The relationship "B is dependent on A" is equivalent to "A determines B," and is written as A → B.

RELATIONAL DATABASE KEYS

KEY TYPE DEFINITION Superkey - An attribute or combination of attributes that uniquely identifies each row in a table Candidate key - A minimal (irreducible) superkey; a superkey that does not contain a subset of attributes that is itself a superkey Primary key - A candidate key selected to uniquely identify all other attribute values in any given row; cannot contain null entries Foreign key - An attribute or combination of attributes in one table whose values must either match the primary key in another table or be null Secondary key - An attribute or combination of attributes used strictly for data retrieval purposes

Key

One or more attributes that determine other attributes. See super key, candidate key, primary key (pk), secondary key, and foreign key.

REFERENTIAL INTEGRITY

Requirement - A foreign key may have either a null entry, as long as it is not a part of its table's primary key, or an entry that matches the primary key value in a table to which it is related; (every non-null foreign key value must reference an existing primary key value). Purpose - It is possible for an attribute not to have a corresponding value, but it will be impossible to have an invalid entry; the enforcement of the referential integrity rule makes it impossible to delete a row in one table whose primary key has mandatory matching foreign key values in another table. Example - A customer might not yet have an assigned sales representative (number), but it will be impossible to have an invalid sales representative (number).

ENTITY INTEGRITY

Requirement - All primary key entries are unique, and no part of a primary key may be null. Purpose - Each row will have a unique identity, and foreign key values can properly reference primary key values. Example - No invoice can have a duplicate number, nor can it be null; in short, all invoices are uniquely identified by their invoice number.

Restict

See Select.

Associative entity

See composite entity.

Bridge entity

See composite entity.

Index

See index.

Relvar

Short for relation variable, a variable that holds a relation. A rel var is a container (variable) for holding relation data, not the relation itself.

Flags

Special codes implemented by designers to trigger a required response, alert end users to specified conditions, or encode values. Flags may be used to prevent nulls by bringing attention to the absence of a value in a table.

Null

The absence of an attribute value. Not that a null is not a blank.

Key attributes

The attributes that form a primary key. See prime attribute.

Entity integrity

The property of a relational table that guarantees each entity has a unique value in a primary key and that the key has no null values.

Determination

The role of a key. in the context of a database table, the statement "A determines B" indicates that knowing the value of attribute A means that the value of attribute B can be looked up.

Synonym

The use of different names to identify the same object, such as an entity, an attribute, or a relationship; synonyms should generally be avoided. See also homonym.

Homonym

The use of the same name to label different attributes. Homonyms generally should be avoided. Some relational software automatically checks for homonyms and either alerts the user to their existence or automatically makes the appropriate adjustments. See also synonym.

Union-compatible

Two or more tables that have the same number of columns and the corresponding columns have compatible domains.

Predicate logic

Used extensively in mathematics to provide a framework in which an assertion (statement of fact) can be verified as either true or false.

Summary

• Tables are the basic building blocks of a relational database. A grouping of related entities, known as an entity set, is stored in a table. Conceptually speaking, the relational table is composed of intersecting rows (tuples) and columns. Each row represents a single entity, and each column represents the characteristics (attributes) of the entities. • Keys are central to the use of relational tables. Keys define functional dependencies; that is, other attributes are dependent on the key and can therefore be found if the key value is known. A key can be classified as a superkey, a candidate key, a primary key, a secondary key, or a foreign key. • Each table row must have a primary key. The primary key is an attribute or combination of attributes that uniquely identifies all remaining attributes found in any given row. Because a primary key must be unique, no null values are allowed if entity integrity is to be maintained. • Although tables are independent, they can be linked by common attributes. Thus, the primary key of one table can appear as the foreign key in another table to which it is linked. Referential integrity dictates that the foreign key must contain values that match the primary key in the related table, or must contain nulls. • The relational model supports several relational algebra functions, including SELECT, PROJECT, JOIN, INTERSECT, UNION, DIFFERENCE, PRODUCT, and DIVIDE. Understanding the basic mathematical forms of these functions gives a broader understanding of the data manipulation options. • A relational database performs much of the data manipulation work behind the scenes. For example, when you create a database, the RDBMS automatically produces a structure to house a data dictionary for your database. Each time you create a new table within the database, the RDBMS updates the data dictionary, thereby providing the database documentation. • Once you know the basics of relational databases, you can concentrate on design. Good design begins by identifying appropriate entities and their attributes and then the relationships among the entities. Those relationships (1:1, 1:M, and M:N) can be represented using ERDs. The use of ERDs allows you to create and evaluate simple logical design. The 1:M relationship is most easily incorporated in a good design; just make sure that the primary key of the "1" is included in the table of the "many."


Kaugnay na mga set ng pag-aaral

BISC208 Mastering Biology Exam 2 (University of Delaware, Dr. DeVito)

View Set

Lab 7.2-7.4 (Module 2): "The Bones Within Us"

View Set

The Science of Nutrition - Chapter 11

View Set

itf+ Test Prep errors FULL LENGTH TEST SET 13

View Set

Chapter 31: The Infant and Family

View Set