CH 3- Database Processing Flashcards
Entity
• An entity is some identifiable thing that users want to track:
– Customers
– Computers
– Sales
Relation
-Relational DBMS products store data about entities in relations, which are a special type of table
Characteristic of relations
-Is a two-dimensional table
characteristics:
1) Rows contain data about an entity.
2) Columns contain data about attributes of the entities.
3) All entries in a column are of the same kind.
4) Each column has a unique name.
5) Cells of the table hold a single value.
6) The order of the columns is unimportant.
7) The order of the rows is unimportant.
8) No two rows may be identical.
Domain Integrity Constraint
-The requirement that all of the values in a column are of the same kind
domain= grouping of data that meets a specific type definition.
**Columns in different relations may have the same name.
Relations as defined by Codd
1) The rows of a relation must be unique.
2) There is no requirement for a designated primary key.
- The requirement for unique rows implies that a primary key can be designated.
- In the “real world,” every relation has a primary key.
Functional Dependencies
-occurs when the value of one (set of) attribute(s) determines the value of a second (set of) attribute(s):
CookieCost = NumberOfBoxes x $5
NumberOfBoxes → CookieCost
-The attribute on the left side of the functional dependency is called the determinant
Functional dependencies may be based on equations:
ExtendedPrice = Quantity X UnitPrice
(Quantity, UnitPrice) → ExtendedPrice
• Function dependencies are not equations!
Composite Determinants
-determinant of a functional dependency that consists of more than one attribute
(StudentNumber, ClassNumber) → (Grade)
Functional Dependency Rules
If A → (B, C), then A → B and A→ C.
– This is the decomposition rule.
• If A → B and A → C, then A → (B, C).
– This is the union rule.
• However,
– if (A , B) → C, then neither A nor B determines C by
itself.
What Makes Determinant Values Unique
-determinant is unique in a relation if and only if it determines every other column in the relation.
keys
-a combination of one or more columns that are used to identify particular rows in a relation
composite key
key that consists of two or more columns.
candidate key
key that determines ALL of the other columns in a relation
primary key
candidate key selected as the primary means of identifying rows in a relation.
– There is only one primary key per relation.
– The primary key may be a single key or a composite key
Entity Integrity Constraint
- the primary key must have unique data values inserted into every row of the table.
- The phrase unique data values implies that this column is NOT NULL, and does not allow a NULL value in any row.
Surrogate Keys
-an artificial column added to a relation to serve as a primary key.
– DBMS supplied
– Short, numeric, and never changes—an ideal primary key
– Has artificial values that are meaningless to users
– Normally hidden in forms and reports