Ch3 Flashcards
Entity
A person, place, event, or thing for which we intend to collect data
Attribute
Describes a characteristics of an entity
Entity Set
A group of entities of the same type
Table/Relation
Contains a group of related entities
Rows and Columns
A table is composed of this
Row
Tuple
Each __ represents a single __ within the entity set
Row, entity
Each ___ represents an ___ and is identified by a district name
Column, Attribute
Each row/column intersection represents a single data value
Atomic
Cardinality
The number of tuples in a table
Degree
The number of column is known as
Attribute Domain
All values in a column must conform to the same data format (type) and must be within a specified range
Changing the order of the rows and/or column___
Does not change the table
Key
Consists of one or more attributes that determines other attributes within an entity
Composite key
A key that composed of more than one attributes
If attribute B is functionally dependent on a composite key A but not any subset of A then B is _____ on A
Fully Functionally dependent
Superkey
An attribute or a combination of attributes that uniquely identifies each row in a table
Candidate Key
A minimal superkey, i.e., it does not contain a subset of attributes that is itself a superkey
Primary Key
A candidate key selected to uniquely identify an entity
Cannot have null values
Enforces Entity Integrity
Is a superkey as well as a candidate
Entity Integrity
Guarantees that each entity is uniquely identified by a non-null primary key value
Foreign Key
An attribute (or a combination of attributes) in one table whose values must either match the primary key values in a designated table to be null
Used to logically link one table with another
Enforces Referential Integrity
Referential Integrity
Guarantees valid references to another table, i.e., cannot delete a tuple from a table that is references by in another table through a foreign key
Secondary Key
Used for data retrieval purpose
May consist of a single attribute or a combination of attributes
The DBMS maintains indexes on secondary keys for faster search and retrieval of data
May have duplicate values
Relational Database Operators
Based on relational algebra theory
Define functions to manipulate data in one or more tables (relations)
Application of a relational operator to one or more tables results in another table
Eight relational operators are:
UNION
INTERSECT
DIFFERENCE
PRODUCT
SELECT
PROJECT
JOIN
DIVIDE
Union Compatibility
Two table are said to be union-compatible when they have the same degree (number of attributes)
Union
The tables must be union compatible
A Union B results in C that contains all tuple from both A and B with no duplicates
Intersect
The tables must be union compatible
A Intersect B results in C that contains tuples that are common to both A and B
Difference
The tables must be union compatible
A MINUS B results in C that contains the tuples that appear in A but not in B
Product
PRODUCT produces a list of all possible pairs of rows from two tables
If table A has 5 rows and B has 10, A product B will yield a table with 50 rows
Select
Yields all attributes of selected tuple that satisfy a specified condition
Produces a horizontal subset of a table
Project
Produces a list of all values for selected attributes
It yields a vertical subset of a table
Join
Allows us to combine information from two or more tables
The tables participating in the join operation must have attributes defined over a common domain
EquiJoin
Compares specified column of two tables based on equality condition
Natural Join
EquiJoin with the duplicate column removed
Performed by a Project on the result of equijoin (Inner Join)
Natural Join
When the term Join is mentioned without any prefix
Outer Join
Unmatched rows from the participating tables are retained in the result table with unmatched attributes left blank or null
Left Outer join
Keeps all tuple from the left relation
Right Outer Join
Keeps all tuple from the right section
Theta Join
EquiJoin with the equality operator replaced by any other comparison operator, such as greater than, less than, etc
Data Dictionary
Contains metadata that describes the data stored in the database
Data Dictionary stores:
The names of the data items in the database
Types and sizes of the data items
Constraints on each data item
Names of authorized users and types of access allowed
System Catalog
Very detailed system data dictionary
Describes all objects within the database
System Catalog cont.
System-created database
Tables can be queried just like any other tables
Automatically produces database documentation
All data dictionary information are found in here