Answers.
What are the 5 SQL built in functions? COUNT
SUM
AVG
MIN
MAX
Entity some identifieable thing that users want to track.
Relation a two-dimensional table that has certain characteristics
Characteristics of a relation - each relation in a database has a unique name
- rows contain data about a specific instance of an entity
- columns contain data about attributes of the entity class
- all entries in a column are of the same kind
- each column in a given table has a unique name
- cells of the table hold a single value
- the order of the columns is unimportant
- the order of the rows is unimportant
- no two rows may be identical
What are two words that can be used interchangably with Table
"Relation" File
What are two words that can be used interchangably with Column
"Attribute" Field
What are two words that can be used interchangably with Row
"Tuple" Record
Functional Dependency occurs when the value of one (set of) attribute(s) determines the value of a
second (set of) attribute(s)
if A > (B,C) then A > B and A > C
if (A,B) > C then neither A nor B determines C by itself
What makes a determinant value unique? a determinant is unique in a relation if and only if, it determines every
other column
in the relation.
You cannot find the determinant of all functional dependencies simply
by looking for unique values in one column
Key a combination of one or more columns that is used to identify rows in a relation.
Composite key a key that consists of two or more columns
1/8
, Candidate key a key that determines all of the other columns in a relation
Primary key a candidate key selected as the primary means of identifying rows in a relation.
There is ony one primary key per relation.
The primary key may may be a composite key
the ideal pimary key is short, numeric, and never changes.
Surrogate key An artificial column added to a relation to serve as a primary key.
Foreign key the primary key of one relation that is placed in another relation to form a link between
the relations.
can be a single column or a compostie key.
the term refers to the fact that key values are foreign to the relation in which they appear
as foreign key values.
referenctial integrity constraint a statement that limits the values of the foreign key to those already existing as primary
key values in the corresponding relation.
Anomaly something unusual, unexpected or abnormal.
bad things when we work with databases.
Modification Anomalies Deletion anomaly
insertion anomaly
update anomaly
Normal form a relation is in normal form if it conforms to a defined set of rules (norms) a
relation that conforms to the x set of rules is said to be in xNF.
The purpose is to help us prevent anomalies.
1NF a table that qualifies as a relation
2NF all of its nonkey attributes are dependent on all the attributes of the primary key
3NF if it is in 2NF and has no determininants except the primary key
Boyce-Codd Normal Form (BCNF) if every determinant is a candidate key.
Process for putting relations into BCNF 1. identify every functional dependency
2. identify every candidate key
3. if there is a functional dependency that has a determinant that is not a candidate key
a. move the columns of that functional dependency into a new relation
b. make the determinant of that functional dependency the primary key of the new
relation
c. leave a copy of the determinant oas a foreign key in the original relation
d. create a referential integrity constraint between the origninal relation and the new
relation.
4. repeat step 3 until every determinant of every relation is a candidate key
2/8