Relations Flashcards
Logical construct also known as a table which is two dimensional has tuples as Rows and attributes as columns with a distinct name (29 cards)
Relations - logical construct also known as a table
two dimensional has two pools as rows attributes as columns with a distinct name
E F Codd
Relational models creator. use the two terms of synonyms for relation whose contents can be permanently saved for future use
Relational database model
Enables logical presentation of the data and its relationships.enables you to view data logically rather than physically. easier to understand than the hierarchical and network models
The logical view
Simplicity yields simple. to effective database design methodologies. 3 facilitated by the creation of data relations which are based on logical construct called a relation AKA as a data set in Microsoft Access
8 characteristics of a relational table
1 the table is two dimensional structure with rows and columns
2 each row is a tuple and represents a single entity occurrence within the entity set
3 each table column represents an attribute and 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. Numeric, character, date, logical
6 each column has a specific range of values known as the attribute domain
7 the order of the Rose and columns does not matter in dbms
8 each table must have a primary key which is an attribute or combination of attributes which uniquely identifies each row
Rule of a key
Based on the concept of determination the state in which knowing the value of one attribute makes it possible to determine the value of another
Functional dependence
The value of one or more attributes determine the value of one or more of the attributes
Determinant or key
The attribute whose value determines another
Dependent
The attribute whose value is determined by the other attribute
Full functional dependence
The entire collection of attributes in the determinant is necessary for the relationship
Key consists of
1 one or more attributes that determine other attributes
2 used to ensure that each row in a table is uniquely identifiable
3 establish relationships among tables
4 insured integrity of the data
Types of keys
The composite key
Composed of more than one attribute
Is a part of the key
Relational database keys - super key and candidate key
Super key a key that can uniquely identify any role in the table
Candidate key minimal or irreducible super key without any unnecessary attributes does not contain a subset of attributes that is itself a super key and it’s based on a functional full functional dependency can have more than one candidate keys in a table or candidates because they are eligible options from which the designer will choose when selecting the primary key
Relational database keys - primary key, foreign key
Primary key is a candidate key selected to uniquely identify all the attributes in a given row in the table cannot contain no entries and controls redundancy that allows the relational model to work
Foreign key is the primary key of one table placed in another table to create a common attribute and is used to ensure referential integrity it’s an attribute or combination of attributes in one table must be a null or a valid value in the primary key of the related table and it can contain duplicates
Relational database key- secondary key
Secondary key is used strictly for data retrieval purposes it does not necessarily yield a unique outcome it’s effective in narrowing down a search depending on how restrictive the key is
Entity integrity
Row (entity instance) has a primary key. attribute in primary key cannot container null
Null
Never allowed in any part of the primary key
Creates problems with functions such as COUNT, AVERAGE and SUM
Special codes are used known as Flags to indicate the absence of some value
Referential integrity
Reference of an entity instance by another entity instance is valid
Foreign keys are used
Null entry as long as it’s not a part of the tables primary key
All none null foreign key value must reference and exist in primary key value
NULLS
1 Indicate my Flags or special codes - none value
2 NOT NULL placed on a column tincture everyone in the table has a value
3 UNIQUE constraint placed on a column to restrict duplicate values
Minimal relational dbms must have
SELECT, PROJECT & JOIN
Relational Set Operators
Select Project Union Intersect Difference Join Divide Product
Joins
Natural Equijoin Theta Inner Outer
Data Dictionay
1 Describes all tables in DB created by user and designer
2 described as the DB designer’s database
Relvar AKA structure
The data in the structure would be a relation which is a variable