Presentation is loading. Please wait.

Presentation is loading. Please wait.

IT 5433 LM3 Relational Data Model. Learning Objectives: List the 5 properties of relations List the properties of a candidate key, primary key and foreign.

Similar presentations


Presentation on theme: "IT 5433 LM3 Relational Data Model. Learning Objectives: List the 5 properties of relations List the properties of a candidate key, primary key and foreign."— Presentation transcript:

1 IT 5433 LM3 Relational Data Model

2 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 3rd normal form

3 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/intro9e/supplement/Suppl ement4fRelationalDataModel.pdf

4 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/intro9e/supplement/Suppl ement4fRelationalDataModel.pdf

5 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/intro9e/supplement/Suppl ement4fRelationalDataModel.pdf

6 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

7 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

8 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

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

10 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 are 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

11 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

12 Links: Link 1: http://www.cs.armstrong.edu/liang/intro9e/supplement/Supplement4fRel ationalDataModel.pdf http://www.cs.armstrong.edu/liang/intro9e/supplement/Supplement4fRel ationalDataModel.pdf Link 2: https://support.microsoft.com/en-us/kb/283878https://support.microsoft.com/en-us/kb/283878 Link 3: http://jcsites.juniata.edu/faculty/rhodes/dbms/ermappinghttp://jcsites.juniata.edu/faculty/rhodes/dbms/ermapping Link 4: http://adbc.kennesaw.edu/index.php?mainmenu=db&submenu=er_notati ons http://adbc.kennesaw.edu/index.php?mainmenu=db&submenu=er_notati ons


Download ppt "IT 5433 LM3 Relational Data Model. Learning Objectives: List the 5 properties of relations List the properties of a candidate key, primary key and foreign."

Similar presentations


Ads by Google