n-ary Relations and Their Applications

Slides:



Advertisements
Similar presentations
Symmetry Definitions for Constraint Satisfaction Problems Dave Cohen, Peter Jeavons, Chris Jefferson, Karen Petrie and Barbara Smith.
Advertisements

Chapter 6: Entity-Relationship Model (part I)
Chronos: A Tool for Handling Temporal Ontologies in Protégé
Temporal Constraints Time and Time Again: The Many Ways to Represent Time James F Allen.
Lecture 11 Last Time: Local Search, Constraint Satisfaction Problems Today: More on CSPs.
Representing and Querying Correlated Tuples in Probabilistic Databases
Probabilistic Latent-Factor Database Models Denis Krompaß 1, Xueyan Jiang 1,Maximilian Nickel 2 and Volker Tresp 1,3 1 Department of Computer Science.
CS2210(22C:19) Discrete Structures Relations Spring 2015 Sukumar Ghosh.
Relational Data Mining in Finance Haonan Zhang CFWin /04/2003.
Module #1 - Logic 1 Based on Rosen, Discrete Mathematics & Its Applications. Prepared by (c) , Michael P. Frank and Modified By Mingwu Chen Relations.
CS34311 The Entity- Relationship Model Part II.. CS34312 Database Design Stages Application Requirements Conceptual Design Logical Design Physical Design.
Binary Numbers.
Database Design & ER Diagrams
Entity Relationship Model Chapter 6. Basic Elements of E-R Model Entity Object of the real world that stores data. Eg. Customer, State, Project, Supplier,
1 Relational model concepts Key constraints Referential integrity constraint Steen Jensen, autumn 2013.
Chapter 4 The Relational Model.
Chapter 3 The Relational Model Transparencies Last Updated: Pebruari 2011 By M. Arief
(CSC 102) Lecture 15 Discrete Structures. Previous Lectures Summary  Procedural Versions  Properties of Sets  Empty Set Properties  Difference Properties.
12 April 2009Instructor: Tasneem Darwish1 University of Palestine Faculty of Applied Engineering and Urban Planning Software Engineering Department Formal.
1 Proof of the Day: Let P= {(b, acbb), (aac, a), (b, ca)}. 1.Prove that P has a match. 2. Find Q which is P encoded in binary. 3.What match of Q corresponds.
Mathematical preliminaries Episode 2 0 Sets Sequences Functions Relations Strings.
computer
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
Logical Design database design. Dr. Mohamed Osman Hegaz2 Conceptual Database Designing –Provides concepts that are close to the way many users perceive.
Databases Illuminated Chapter 3 The Entity Relationship Model.
Number Base Relationships F451 AS WBGS How to explain the relationship between binary and Octal/Hex values.
1 Database Environment. 2 Objectives of Three-Level Architecture All users should be able to access same data. A user’s view is immune to changes made.
Logical Database Design Transparencies 1. ©Pearson Education 2009 Objectives How to create a set of tables from an ER model. How to check that the tables.
MIS5102: Process Improvement and Innovation Overview of Project Management.
Chapter 3 The Relational Model. Objectives u Terminology of relational model. u How tables are used to represent data. u Connection between mathematical.
Approximation by Constraints Why do we need approximation/interpolation? –Record values at some finite set of points in space and time. –Does not capture.
Database vs File System Integrated Data Reduced Data Duplication Program/Data Independence Easier representation for user Separate/Isolated data Appl.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
Lewis Dot Diagrams for Covalent Molecules. 3 Types of Representations 1. Lewis structures of compound 2. molecular formula: H 2 3. structural formula:
COP Introduction to Database Structures
Relational Database Design by ER- and EER-to- Relational Mapping
Database Management System
Chapter 4: Part B Logical Database Design and the Relational Model
Building AST's for RPAL Programs
COMPUTER ORGANIZATION
Applied Discrete Mathematics Week 10: Relations
TYPES OF RELATIONSHIPS
CSE 504 Discrete Structures & Foundations of Computer Science
Entity/Relationship Model
Discrete Structures for Computer Science
Data Base System Lecture 9: Rational Algebra and Relational Calculus
Database.
Lecture 16: Probabilistic Databases
The Entity-Relationship Model
CS2210 Discrete Structures Relations
Entity-Relationship Modeling
الفصل الخامس قواعد البيانات Databases
Entity – Relationship Model
Discrete Math (2) Haiming Chen Associate Professor, PhD
CSPs and Relational DBs
Multiplying Like Bunnies
Problem Solving with Constraints
Topic 1: Data Representation
376a. Database Design Dept. of Computer Science Vassar College
Relations and their Properties
Building AST's for RPAL Programs
Chapter 7: Entity-Relationship Model
7.1 – Functions of Several Variables
ICOM 5016 – Introduction to Database Systems
Problem Solving with Constraints
Problem Solving with Constraints
Binary.
Relational Database Design by ER-to-Relational Mapping
Presentation transcript:

n-ary Relations and Their Applications Rosen 8.2

We can have relation between more than just 2 sets n-ary relations We can have relation between more than just 2 sets A binary relation involves 2 sets and can be described by a set of pairs A ternary relation involves 3 sets and can be described by a set of triples … An n-ary relation involves n sets and can be described by a set of n-tuples Relations are used to represent computer databases Also used to represent constraints!

n-ary relations n-ary Relations

Note: N is the set of natural numbers {0,1,2,3,…} n-ary relations An example n-ary Relations Note: N is the set of natural numbers {0,1,2,3,…} The relation has degree 3 The domains of the relation are the set of natural numbers Note: R could be considered as an extensional representation of the ternary relation a<b<c, assuming domains are finite and really quite small

Note: N is the set of natural numbers {0,1,2,3,…} n-ary relations An example n-ary Relations Note: N is the set of natural numbers {0,1,2,3,…} Z is the set of integers {…,-2,-1,0,1,2,…} The relation has degree 4 Note: R could be considered as an extensional representation of the ternary relation a<b<c, assuming domains are finite and really quite small

Relational databases Database is made up of records. Typical operations on a database are find records that satisfy a given criteria delete records add records update records Some everyday databases student records health records tax information telephone directories banking records … Databases may be represented using the relational model

Relational databases The relational data model Database made up of records, they are n-tuples, made up of fields Student record might look as follows (name,metricNo,faculty,gpa) gpa is an attribute (Jones,200401986,Arts,4.9) (Lee,200408972,Science,3.6) (Kuhns,200501728,Humanities,5.0) (Moore,200308327,Science,5.5) relations (in relDB) also called tables

Relational databases The relational data model Attributes: name, metric No, Dept and GPA Example from the book

Relational databases The relational data model primary key: An attribute/domain/column is a primary key when the value of this attribute uniquely defines tuples i.e. no two tuples have the same value for that attribute Name cannot be a primary key, neither can Dept or GPS metricNo is a primary key

Relational databases The relational data model The current collection of n-tuples (records) in the relation (table) is called the extension of the relation The permanent aspects of the relation (table) such as the attribute names is called the intention of the relation

Relational databases The relational data model A composite key is a combination of attributes That uniquely define tuples

Relational databases Operations on n-ary relations Selection

Relational databases Operations on n-ary relations Selection

Relational databases Projection Operations on n-ary relations It strips out specific columns

Relational databases Operations on n-ary relations Projection

Relational databases Join Operations on n-ary relations Joins two tables/relations together, matching up on specific attributes

Relational databases Operations on n-ary relations Join

Explain the previous slide Explain how what we do differs from what will be presented in IM2