THE RELATIONAL DATA MODEL CHAPTER 3 (6/E) CHAPTER 5 (5/E)

Similar documents
The Basic (Flat) Relational Model. Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

ITCS 3160 DATA BASE DESIGN AND IMPLEMENTATION

CS275 Intro to Databases

CS 377 Database Systems

The Relational Data Model and Relational Database Constraints

ACS-3902 Fall Ron McFadyen 3D21 Slides are based on chapter 5 (7 th edition) (chapter 3 in 6 th edition)

Relational Data Model. Christopher Simpkins

Chapter 5. The Relational Data Model and Relational Database Constraints. Slide 5-١. Copyright 2007 Ramez Elmasri and Shamkant B.

Copyright 2007 Ramez Elmasri and Shamkant B. Navathe. Slide 5-1

CSE 132A Database Systems Principles

ECE 650 Systems Programming & Engineering. Spring 2018

Database Technology. Topic 2: Relational Databases and SQL. Olaf Hartig.

Chapter 5. Relational Model Concepts 9/4/2012. Chapter Outline. The Relational Data Model and Relational Database Constraints

01/01/2017. Chapter 5: The Relational Data Model and Relational Database Constraints: Outline. Chapter 5: Relational Database Constraints

CS530 Database Architecture Models. Database Model. Prof. Ian HORROCKS. Dr. Robert STEVENS. and Design The Relational

Copyright 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 5-1

Chapter 5. Relational Model Concepts 5/2/2008. Chapter Outline. Relational Database Constraints

Let s briefly review important EER inheritance concepts

Running Example Tables name location

Database Management System 9

Supplier-Parts-DB SNUM SNAME STATUS CITY S1 Smith 20 London S2 Jones 10 Paris S3 Blake 30 Paris S4 Clark 20 London S5 Adams 30 Athens

Chapter 3: Relational Model

A database can be modeled as: + a collection of entities, + a set of relationships among entities.

Database Systems Relational Model. A.R. Hurson 323 CS Building

In mathematical terms, the relation itself can be expressed simply in terms of the attributes it contains:

Chapter 2: Intro to Relational Model

Chapter 2: Relational Model

COSC344 Database Theory and Applications. σ a= c (P) Lecture 3 The Relational Data. Model. π A, COSC344 Lecture 3 1

CS34800 Information Systems. The Relational Model Prof. Walid Aref 29 August, 2016

CSC 742 Database Management Systems

Chapter 2: Relational Model

The data structures of the relational model Attributes and domains Relation schemas and database schemas

CSIT5300: Advanced Database Systems

Relational Algebra. Relational Algebra. 7/4/2017 Md. Golam Moazzam, Dept. of CSE, JU

Chapter 6: RELATIONAL DATA MODEL AND RELATIONAL ALGEBRA

Relational terminology. Databases - Sets & Relations. Sets. Membership

SET DEFINITION 1 elements members

Relational Database: The Relational Data Model; Operations on Database Relations

Steps in normalisation. Steps in normalisation 7/15/2014

Relational model continued. Understanding how to use the relational model. Summary of board example: with Copies as weak entity

Relational Algebra. Lecture 4A Kathleen Durant Northeastern University

Comp 5311 Database Management Systems. 2. Relational Model and Algebra

Relational Model Concepts

Review of Sets. Review. Philippe B. Laval. Current Semester. Kennesaw State University. Philippe B. Laval (KSU) Sets Current Semester 1 / 16

Database System Concepts

The Relational Model. CS157A Chris Pollett Sept. 19, 2005.

Introduction to modeling

Informal Design Guidelines for Relational Databases

Database System Concepts, 5 th Ed.! Silberschatz, Korth and Sudarshan See for conditions on re-use "

Chapter 2: Intro to Relational Model

Chapter 3 Outline. Relational Model Concepts. The Relational Data Model and Relational Database Constraints Database System 1

Chapter 4. The Relational Model

Chapter 3. The Relational Model. Database Systems p. 61/569

Mapping ER Diagrams to. Relations (Cont d) Mapping ER Diagrams to. Exercise. Relations. Mapping ER Diagrams to Relations (Cont d) Exercise

Data Modeling with the Entity Relationship Model. CS157A Chris Pollett Sept. 7, 2005.

Introduction to Database Systems. The Relational Data Model

Introduction to Relational Databases. Introduction to Relational Databases cont: Introduction to Relational Databases cont: Relational Data structure

IS 263 Database Concepts

Database Technology Introduction. Heiko Paulheim

Data Modeling. Yanlei Diao UMass Amherst. Slides Courtesy of R. Ramakrishnan and J. Gehrke

Relational Databases

Databases The theory of relational database design Lectures for m

CS 377 Database Systems

Chapter 2 Introduction to Relational Models

Databases. Jörg Endrullis. VU University Amsterdam

Intro to DB CHAPTER 6

Lecture Notes for 3 rd August Lecture topic : Introduction to Relational Model. Rishi Barua Shubham Tripathi

ER to Relational Mapping

Relational Model and Relational Algebra

Web Science & Technologies University of Koblenz Landau, Germany. Relational Data Model

Relational Algebra. Procedural language Six basic operators

DATABASE TECHNOLOGY - 1DL124

LECTURE 8: SETS. Software Engineering Mike Wooldridge

Overview. CS389L: Automated Logical Reasoning. Lecture 6: First Order Logic Syntax and Semantics. Constants in First-Order Logic.

Introduction to Database Systems. The Relational Data Model. Werner Nutt

A set with only one member is called a SINGLETON. A set with no members is called the EMPTY SET or 2 N

E-R Diagram. Bagian I Entity Concept

DATABASE MANAGEMENT SYSTEM SHORT QUESTIONS. QUESTION 1: What is database?

CONSTRAINTS AND UPDATES CHAPTER 3 (6/E) CHAPTER 5 (5/E)

The Relational Model and Relational Algebra

Entity-Relationship Modelling. Entities Attributes Relationships Mapping Cardinality Keys Reduction of an E-R Diagram to Tables

Database Management Systems Paper Solution

Applied Databases. Sebastian Maneth. Lecture 5 ER Model, normal forms. University of Edinburgh - January 25 th, 2016

Database Management System Dr. S. Srinath Department of Computer Science & Engineering Indian Institute of Technology, Madras Lecture No.

Database Design Theory and Normalization. CS 377: Database Systems

Relational Model: History

Query formalisms for relational model relational calculus

CONSTRAINTS AND UPDATES CHAPTER 3 (6/E) CHAPTER 5 (5/E)

Relational model. Jaroslav Porubän, Miroslav Biňas, Milan Nosáľ (c)

Ordered structures. Dr. C. Constantinides. Department of Computer Science and Software Engineering Concordia University Montreal, Canada

Applied Databases. Sebastian Maneth. Lecture 5 ER Model, Normal Forms. University of Edinburgh - January 30 th, 2017

Introduction to Data Management. Lecture #4 (E-R Relational Translation)

The Relational Model. Roadmap. Relational Database: Definitions. Why Study the Relational Model? Relational database: a set of relations

Chapter 14. Database Design Theory: Introduction to Normalization Using Functional and Multivalued Dependencies

Relational Model History. COSC 304 Introduction to Database Systems. Relational Model and Algebra. Relational Model Definitions.

Chapter 10. Chapter Outline. Chapter Outline. Functional Dependencies and Normalization for Relational Databases

The Relational Data Model (ALL the Vocabulary)

Database Management System (15ECSC208) UNIT I: Chapter 2: Relational Data Model and Relational Algebra

customer = (customer_id, _ customer_name, customer_street,

In This Lecture. The Relational Model. The Relational Model. Relational Data Structure. Unnamed and named tuples. New thing:scheme (and attributes)

Transcription:

1 THE RELATIONAL DATA MODEL CHAPTER 3 (6/E) CHAPTER 5 (5/E)

2 LECTURE OUTLINE Relational Model Concepts Relational Database Schemas Update Operations Brief History of Database Applications (from Section 1.7)

3 RELATIONAL MODEL CONCEPTS Represent data as a collection of relations Table of values Each row (tuple) Represents a record of related data values Facts that typically correspond to a real-world entity or relationship Each column (attribute) Holds a corresponding value for each row Slot for a specific interpretation for a row

4 RELATIONAL MODEL (CONT D.) Schema describes table Table name, attribute names and types Instance denotes the current contents of the table The relation (or relation state)

5 DOMAINS Domain D Set of atomic values {0,1,2, } {Jo Smith, Dana Jones, Ashley Wong, Y. K. Lee, } Atomic Each value indivisible Domain specified by Data type rather than by enumeration Integer, String, Date, Real, etc. Can be specified by format: (ddd)ddd-dddd

6 SCHEMAS AND ATTRIBUTES Relation schema A relation name R and a list of attributes: A 1, A 2,..., A n Denoted by R(A 1, A 2,..., A n ) Attribute A i Name of a role in the relation schema R Associated with a domain dom(a i ) Attribute names do not repeat within relation schema, but domains can repeat. Degree (or arity) of a relation Number of attributes n in its relation schema

8 FORMALIZATION Relation (or relation state) Set of n-tuples r = {t 1, t 2,..., t m } Unordered, no duplicates Each n-tuple t Ordered list of n values t =<v 1, v 2,..., v n > Each value v i, 1 i n, is an element of dom(a i ) Instance of relation schema R(A 1, A 2, A 3,, A n ) Finite subset of the Cartesian product of the domains defining R: rel(r) (dom(a 1 ) dom(a 2 )... dom(a n )) Because of updates, relations are time-varying rel(r) is relation state at a given time Reflects only (and all) the valid tuples that represent a particular state of the real world

9 RELATIONAL MODEL NOTATION Symbolic notation Uppercase letters Q, R, S denote relation names Corresponding lowercase letters q, r, s denote corresponding relation states Uppercase letters A, B, C,, H denote attributes Attribute A can be qualified with the relation name R to which it belongs using the dot notation, e.g., R.A Lower case letters t, u, v denote tuples

10 ALTERNATIVE DEFN OF RELATION Tuple considered as a function from attributes to values t j : {A 1, A 2, A 3,, A n } dom(a 1 ) dom(a 2 ) dom(a n ) Use notation t j [A i ] or t j.a i to refer to tuple s value v i from dom(a i ) Similarly t j [A u, A w,..., A z ] and t j.(a u, A w,..., A z ) refer to the subtuple of values <v u, v w,..., v z > from t j for attributes A u, A w,..., A z Therefore, tuple is a set of <attribute, value> pairs e.g., for attendee (id, givenname, surname, company, dateofbirth) t = <10483, John, Doe, IBM, 1978-11-05> t[id] = 10483, t[givenname] = John, t[surname] = Doe, t[company] = IBM, t[dateofbirth] = 1978-11-05 t.id = 10483, t.givenname = John, t.surname = Doe, t.company = IBM, t.dateofbirth = 1978-11-05 t = { <id, 10483>, <givenname, John>, <surname, Doe>, <company, IBM>, <dateofbirth, 1978-11-05> }

11 VALUES IN TUPLES Each value in a tuple is atomic Flat (as opposed to nested) relational model Composite and multivalued attributes not allowed Historically relation is said to be in First normal form (1NF) Composite attributes Split into simple component attributes e.g., Waterloo, Ontario treated as atomic or split into two attributes to store Waterloo separately from Ontario Multivalued attributes Must be represented by separate relations Recall: Director could be stored as attribute of FILM because only one director per film assumed, but multiple characters in a film implies that ROLE must have its own relation.

12 NULL VALUES Assume each domain is augmented with a special NULL value Represent the values of attributes that may be unknown or may not apply to a tuple Interpretations for NULL values Nothing is known about the value Value exists but is (currently) not available Value undefined i.e., attribute does not apply to this tuple If an attribute for a tuple is mapped to NULL, cannot make any assumptions about the value for that attribute (for that tuple) e.g., Ashley s telephone number is NULL could mean Ashley doesn t have a phone Ashley has a phone but we don t know the number (perhaps withheld) Ashley has a phone that has no number Ashley may or may not have a phone, but regardless we don t have a number for Ashley

13 MEANING OF A RELATION Assertion Each tuple in the relation interpreted as a fact. No other similar facts are of interest to the enterprise. e.g., a relation for Classlist includes only registered students and all registered students are included in Classlist Predicate presence in list registered student Values in each tuple interpreted as values that satisfy predicate e.g., Name of student having ID 83201556 is Lee Wong

14 LECTURE SUMMARY Characteristics differentiate relations from ordinary tables or files Schemas vs. instances (states) Formal definitions for relations and tuples Null values