Ihr Logo Fundamentals of Database Systems Fourth Edition El Masri & Navathe Chapter 5 The Relational Data Model and Relational Database Constraints.

Slides:



Advertisements
Similar presentations
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3 The Basic (Flat) Relational Model.
Advertisements

The Relational Data Model (Based on Chapter 5)
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 5- 1.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 5- 1.
Chapter 5 The Relational Data Model and Relational Database Constraints Copyright © 2004 Pearson Education, Inc.
Database Systems Chapter 5 ITM 354. Chapter Outline Relational Model Concepts Relational Model Constraints and Relational Database Schemas Update Operations.
Chapter 5 The Relational Data Model and Relational Database Constraints.
CS 405G: Introduction to Database Systems Lecture 4: Relational Model Instructor: Chen Qian.
Elmasri and Navathe, Fundamentals of Database Systems, Fourth Edition Copyright © 2004 Pearson Education, Inc. Slide 2-1 Data Models Example: A relation.
Chapter 5 Relational Model Concepts Dr. Bernard Chen Ph.D. University of Central Arkansas.
CS 380 Introduction to Database Systems (Chapter 5: The Relational Data Model and Relational Database Constraints)
The Relational Data Model 1.Relational Model Concepts 2.Characteristics of Relations 3.Relational Integrity Constraints 3.1Key Constraints 3.2Entity Integrity.
1 The Relational Data Model, Relational Constraints, and The Relational Algebra.
Chapter 4 Rational data model. Chapter 5 Rational data model Chapter 4 Rational data model.
Content Resource- Elamsari and Navathe, Fundamentals of Database Management systems.
CPT-S Topics in Computer Science Big Data
FEN  Concepts and terminology  Operations (relational algebra)  Integrity constraints The relational model.
CG084&085 / / 1 The Relational Data Model Properties of Relations Keys and Constraints.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3 The Relational Data Model and SQL.
Topic 5 The Relational Data Model and Relational Database Constraints Faculty of Information Science and Technology Mahanakorn University of Technology.
Instructor: Churee Techawut Basic Concepts of Relational Database Chapter 5 CS (204)321 Database System I.
DatabaseIM ISU1 Fundamentals of Database Systems Chapter 5 The Relational Data Model.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 5- 1.
The Relational Data Model and Relational Database Constraints
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 5- 1 Week4 Relational Model and Relational Database Constraints Relational Model Concepts.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 5- 1.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 5 The Relational Data Model and Relational Database Constraints.
1 CSE 480: Database Systems Lecture 5: Relational Data Model.
METU Department of Computer Eng Ceng 302 Introduction to DBMS The Relational Data Model and Relational Database Constraints by Pinar Senkul resources:
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 5 The Relational Data Model and Relational Database Constraints.
Chapter 6 The Relational Data Model and the Relational Algebra.
Slide Chapter 5 The Relational Data Model and Relational Database Constraints.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 3 The Basic Relational Model.
CSE314 Database Systems Lecture 3 The Relational Data Model and Relational Database Constraints Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 5- 1.
Relational Data Model DeSiaMore Powered by DeSiaMore.
Chapter 5 The Relational Data Model and Relational Database Constraints Copyright © 2004 Pearson Education, Inc.
1 CSBP430 – Database Systems Chapter 7 - The Relational Data Model Elarbi Badidi College of Information Technology United Arab Emirates University
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe CHAPTER 5 The Relational Data Model and Relational Database Constraints Slide 1- 1.
The Relational Data Model and Relational Database Constraints
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 5- 1.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 5- 1.
The Relational Data Model and Relational Database Constraints.
4/28/2017 Chapter 5 The Relational Data Model and Relational Database Constraints.
Chapter 3 The Relational Data Model and Relational Database Constraints Copyright © 2004 Pearson Education, Inc.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3 The Relational Data Model and Relational Database Constraints تنبيه.
Lecture # 11 & 12 (First Exam) Chapter # 5 The Relational Data Model and Relational Database Constraints Database Systems.
Copyright © 2004 Pearson Education, Inc.
4/20/2018.
The Relational Data Model and Relational Database Constraints
Database Design The Relational Model Text Ch5
Chapter (9) ER and EER-to-Relational Mapping, and other Relational Languages Objectives How a relational database schema can be created from a conceptual.
Lecture # 13 (After 1st Exam)
The Relational Data Model
The Relational Data Model and Relational Database Constraints
The Relational Data Model and Relational Database Constraints
The Relational Data Model and Relational Database Constraints
CS4222 Principles of Database System
12/7/2018.
The Relational Data Model and Relational Database Constraints
4/8/2019.
The Relational Data Model and Relational Database Constraints
The Relational Data Model and Relational Database Constraints
5/12/2019.
Chapter (7) ER-to-Relational Mapping, and other Relational Languages
Copyright © 2004 Pearson Education, Inc.
The Relational Data Model and Relational Database Constraints
The Relational Data Model and Relational Database Constraints
Presentation transcript:

Ihr Logo Fundamentals of Database Systems Fourth Edition El Masri & Navathe Chapter 5 The Relational Data Model and Relational Database Constraints

Your Logo Relational Model Concepts  The relational Model of Data is based on the concept of a Relation.  A Relation is a mathematical concept based on the ideas of sets.  The strength of the relational approach to data management comes from the formal foundation provided by the theory of relations

Your Logo INFORMAL DEFINITIONS RELATION: A table of values A relation may be thought of as a set of rows. A relation may alternately be though of as a set of columns. Each row represents a fact that corresponds to a real-world entity or relationship. Each row has a value of an item or set of items that uniquely identifies that row in the table. Sometimes row-ids or sequential numbers are assigned to identify the rows in the table. Each column typically is called by its column name or column header or attribute name.

Your Logo INFORMAL DEFINITIONS  The Schema of a Relation: R (A1, A2,.....An) Relation schema R is defined over attributes A1, A2,.....An For Example CUSTOMER (Cust-id, Cust-name, Address, Phone#)  Here, CUSTOMER is a relation defined over the four attributes Cust-id, Cust-name, Address, Phone#, each of which has a domain or a set of valid values. For example, the domain of Cust-id is 6 digit numbers

Your Logo INFORMAL DEFINITIONS  A tuple is an ordered set of values  Each row in the CUSTOMER table may be referred to as a tuple in the table and would consist of four values. is a tuple belonging to the CUSTOMER relation.  A relation may be regarded as a set of tuples (rows).  Columns in a table are also called attributes of the relation.

Your Logo INFORMAL DEFINITIONS  Database Schema: Relational database schema is a set of relations schemas R’s. Example: Company={ CUSTOMER (Cust-id, Cust-name, Address, phone#), Employee(Emp_id, Emp_name, Salary, DOB), Department(Dept_id, Dept_name, Location), …………………….}  Relation Instance: The contents of a relation R at some potential time (Snapshot) and is denoted by (r). r ={set of tuples at some pointed time} Example: For the Department relation r ={,,, ……}

Your Logo DEFINITION SUMMARY Informal TermsFormal Terms TableRelation ColumnAttribute/Domain RowTuple Values in a columnDomain Table DefinitionSchema of a Relation Populated TableExtension

Your Logo Example

Your Logo CHARACTERISTICS OF RELATIONS  Ordering of tuples in a relation r(R): The tuples are not considered to be ordered, even though they appear to be in the tabular form.  Ordering of attributes in a relation schema R (and of values within each tuple): We will consider the attributes in R(A1, A2,..., An) and the values in t= to be ordered.  Values in a tuple: All values are considered atomic (indivisible).

Your Logo 10 CHARACTERISTICS OF RELATIONS  Ordering of tuples in a relation r(R): The tuples are not considered to be ordered, even though they appear to be in the tabular form.  Ordering of attributes in a relation schema R (and of values within each tuple): We will consider the attributes in R(A1, A2,..., An) and the values in t= to be ordered.  Values in a tuple: All values are considered atomic (indivisible).

Your Logo CHARACTERISTICS OF RELATIONS  Notation: We refer to component values of a tuple t by t[Ai] = vi (the value of attribute Ai for tuple t). Similarly, t[Au, Av,..., Aw] refers to the subtuple of t containing the values of attributes Au, Av,..., Aw, respectively. Example: for the relation employee t1[emp_id]=1001 t3[emp_name, dob, salary]=hind,1/5/1980,700

Your Logo Relational Integrity Constraints  Constraints are conditions that must hold on all valid relation instances. There are three main types of constraints: 1.Key constraints 2.Entity integrity constraints 3.Referential integrity constraints

Your Logo Key Constraints  A super Key: A key that may or may not contain a redundant attributes Example: ssn  super key ssn,salary  super key  A Minimal Key: A super key that don’t contain any redundant attributes Example: ssn  minimal key  A Candidate Key: A minimal key that is nominated for an entity set during the dsign Example: for the relation deparment, either D_name or D_num can be a key for the relation department. So D_name, D_num are candidate Keys for Department.

Your Logo Key Constraints (Cont.)  A Primary Key: The candidate key that is choosen for implementation.  Alternative Key: A key that can be primary, but we don’t choose it.  Foreign Key: One ore more attributes that are used in a relation, but they are used as a primary keys in another relation ( for the purpose of making relationships ) The value of the foreign key can be: 1.Null. 2.Value that exists in the primary key that it refers to.

Your Logo Referential Integrity  A constraint involving two relations (the previous constraints involve a single relation).  Used to specify a relationship among tuples in two relations: the referencing relation and the referenced relation.  Tuples in the referencing relation R1 have attributes FK (called foreign key attributes) that reference the primary key attributes PK of the referenced relation R2. A tuple t1 in R1 is said to reference a tuple t2 in R2 if t1[FK] = t2[PK].  A referential integrity constraint can be displayed in a relational database schema as a directed arc from R1.FK to R2.

Your Logo

17

Your Logo 18