Chapter 3 Flashcards
What are the characteristics of a relational table?
1) A table is perceived as a 2-dim structure composed of rows and columns.
2) Each table row 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 knows 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 (each row has a unique entity, that distinguish these records from others).
What is a primary key?
Is a key that will identify the whole row (record). For example, the student number (n…) is the primary key that uniquely identifies any given row. Can be a single or, two or more. You have to set it up (not automatic).
All of the values in the primary key must be unique.
No key attribute in the primary key can contain a null
What is a foreign key?
The primary key of one table that has been placed into another table to create common attribute
What is Functional dependence?
Value of one or more attributes determines the value of one or more other attributes
What is Determinant?
Attribute whose value determines another. only the primary key is called determinate.
What is Dependent?
Attribute whose value is determined by the other attribute
What is Superkey?
A key that can uniquely identify any row in the table.
What is Secondary key?
Key used strictly for data retrieval purposes.
What are the ways of handling Nulls?
Flags: Special codes used to indicate the absence of some value (pop-up messages).
NOT NULL constraint, For example, we cannot duplicate student number (N…)
UNIQUE constraint
What is relational algebra?
Theoretical way of manipulating table contents using relational operators.
What is a Relvar?
Variable that holds a relation.
What is a closure?
Use of relational algebra operators on existing relations produces new relations.
What is select as a relational operator?
Filtering in the database. You are selecting pieces or all data of the database. For example, “Select all” or “Select only price less than $2.00 yields”.
What is project as a relational operator?
A projecting (focusing) what you are looking for. Will choose one attribute (not the whole record) –> creating a new table. Väljer en kolumn och skapar en ny tabell
What is union as a relational operator?
Unionizing (adding) tables. Do not have to repeat if they are already in the table (you do not want duplicates).