IT 5433 LM 3 Relational Data Model Learning

  • Slides: 12
Download presentation
IT 5433 LM 3 Relational Data Model

IT 5433 LM 3 Relational Data Model

Learning Objectives: • List the 5 properties of relations • List the properties of

Learning Objectives: • List the 5 properties of relations • List the properties of a candidate key, primary key and foreign key. • Be proficient in converting ERD into relational data model • Explain and use normalization up to 3 rd normal form

Properties of Relations • A relational data model describes data in terms of relations.

Properties of Relations • A relational data model describes data in terms of relations. • A relational data model has three key components: structure, integrity, and languages. • Structure defines the representation of the data. • Integrity imposes constraints on the data. • Language provides the means for accessing and manipulating data. • A relational database consists of a set of relations. A relation has two things in one: a schema and an instance of the schema. http: //www. cs. armstrong. edu/liang/intro 9 e/supplement/Suppl ement 4 f. Relational. Data. Model. pdf

Properties of Relations • For convenience with no confusion, we refer instances of relations

Properties of Relations • For convenience with no confusion, we refer instances of relations as just relations or tables. • Tables describe the relationship among data. • In the relational database theory, a row is called a tuple and a column is called an attribute. • The number of the columns is called the degree of the relation and the number of the rows is called the cardinality of the relation. http: //www. cs. armstrong. edu/liang/intro 9 e/supplement/Suppl ement 4 f. Relational. Data. Model. pdf

Properties of Relations • A relation has the following characteristics: • No two records

Properties of Relations • A relation has the following characteristics: • No two records in the table are identical. • The order of the records does not matter. • The order of the columns does not matter. • Each value in the column is atomic, which means that it cannot be decomposed. http: //www. cs. armstrong. edu/liang/intro 9 e/supplement/Suppl ement 4 f. Relational. Data. Model. pdf

Properties of a Candidate key • A candidate key is an attribute of all

Properties of a Candidate key • A candidate key is an attribute of all entity types in the hierarchy. • It is possible that a relation has several keys. e. g. , Id below http: //jcsites. juniata. edu/faculty/rhodes/dbms/ermapping

Properties of a Primary key • Unique • Not NULL • Fully functional dependency

Properties of a Primary key • Unique • Not NULL • Fully functional dependency • Indexed • The primary key can be defined in the logical database schema using the create table statement in SQL. • The primary key constraint specifies that the primary key value of a tuple cannot be null and no two tuples in the relation can have the same value on the primary key. http: //jcsites. juniata. edu/faculty/rhodes/dbms/ermapping

Properties of a Foreign key • If, for a particular participant entity type, each

Properties of a Foreign key • If, for a particular participant entity type, each entity participates in at most one relationship, its corresponding role is a foreign key relationship type. • The representation in an E-R diagram is an arrow. • A set of attributes FK is a foreign key in a relation R that references relation T if it satisfies the following two rules: • The attributes in FK have the same domain as the primary key in T. • A non-null value on FK in R must match a primary key value in T. http: //jcsites. juniata. edu/faculty/rhodes/dbms/ermapping

Converting ERD into Relational Data Model • 1: 1 • Incomplete, overlapping http: //adbc.

Converting ERD into Relational Data Model • 1: 1 • Incomplete, overlapping http: //adbc. kennesaw. edu/index. php? mainmenu=db&submen u=er_notations

Normalization • Normalization is the process of organizing data in a database. This includes

Normalization • Normalization is the process of organizing data in a database. This includes creating tables and establishing relationships between those tables according to rules designed both to protect the data and to make the database more flexible by eliminating redundancy and inconsistent dependency. • There a few rules for database normalization. Each rule is called a "normal form. " If the first rule is observed, the database is said to be in "first normal form. " If the first three rules are observed, the database is considered to be in "third normal form. " Although other levels of normalization are possible, third normal form is considered the highest level necessary for most applications. https: //support. microsoft. com/en-us/kb/283878

Normal Form First Normal Form • Eliminate repeating groups in individual tables. • Create

Normal Form First Normal Form • Eliminate repeating groups in individual tables. • Create a separate table for each set of related data. • Identify each set of related data with a primary key. Second Normal Form • Create separate tables for sets of values that apply to multiple records. • Relate these tables with a foreign key. Third Normal Form • Eliminate fields that do not depend on the key. https: //support. microsoft. com/en-us/kb/283878

Links: • Link 1: http: //www. cs. armstrong. edu/liang/intro 9 e/supplement/Supplement 4 f. Rel

Links: • Link 1: http: //www. cs. armstrong. edu/liang/intro 9 e/supplement/Supplement 4 f. Rel ational. Data. Model. pdf • Link 2: https: //support. microsoft. com/en-us/kb/283878 • Link 3: http: //jcsites. juniata. edu/faculty/rhodes/dbms/ermapping • Link 4: http: //adbc. kennesaw. edu/index. php? mainmenu=db&submenu=er_notati ons