Discrete Math (2) Haiming Chen Associate Professor, PhD

Slides:



Advertisements
Similar presentations
n-ary Relations and Their Applications
Advertisements

22C:19 Discrete Structures Advanced Counting Spring 2014 Sukumar Ghosh.
CS 101 Attendance 3/27/14. A query using “AND” will A.Generate more answers than the same thing with OR B.Generate fewer answers than the same query with.
22C:19 Discrete Math Relations Fall 2010 Sukumar Ghosh.
Relational Algebra, Join and QBE Yong Choi School of Business CSUB, Bakersfield.
CS2210(22C:19) Discrete Structures Relations Spring 2015 Sukumar Ghosh.
SQL Tutorial Introduction to Database. Learning Objectives  Read and write Data Definition grammar of SQL  Read and write data modification statements.
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 8: Relations Relations(8.1) n-any Relations &
© Pearson Education Limited, Chapter 2 The Relational Model Transparencies.
8.2 n-ary Relations and Their Applications
DATABASE MANAGEMENT SYSTEMS BASIC CONCEPTS 1. What is a database? A database is a collection of data which can be used: alone, or alone, or combined /
Copyright © Curt Hill The Relational Algebra What operations can be done?
Introduction to Database Lei Yang Computer Science Department.
April 10, 2002Applied Discrete Mathematics Week 10: Relations 1 Counting Relations Example: How many different reflexive relations can be defined on a.
Computer Science 101 Database Concepts. Database Collection of related data Models real world “universe” Reflects changes Specific purposes and audience.
Chapter 9. Chapter Summary Relations and Their Properties Representing Relations Equivalence Relations Partial Orderings.
Relations and Their Properties
Chapter 7: Relations Relations(7.1) Relations(7.1) n-any Relations & their Applications (7.2) n-any Relations & their Applications (7.2)
Database Management Supplement 1. 2 I. The Hierarchy of Data Database File (Entity, Table) Record (info for a specific entity, Row) Field (Attribute,
Relations. Important Definitions We covered all of these definitions on the board on Monday, November 7 th. Definition 1 Definition 2 Definition 3 Definition.
Presented By: Miss N. Nembhard. Relation Algebra Relational Algebra is : the formal description of how a relational database operates the mathematics.
Mining real world data RDBMS and SQL. Index RDBMS introduction SQL (Structured Query language)
Jennifer Widom Relational Databases The Relational Model.
N-ary Relations & Their Applications. 2 n-ary Relations Let A 1, A 2, …, A n be sets. An n-ary relation on these sets is a subset of A 1 x A 2 x … x A.
2012 년 봄학기 강원대학교 컴퓨터과학전공 문양세 이산수학 (Discrete Mathematics) n- 항 관계 (n-ary Relations)
1 CS122A: Introduction to Data Management Lecture #4 (E-R  Relational Translation) Instructor: Chen Li.
L1-S1 Infinite R-DB 2003 SJSU -- CmpE Database Design Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College of Engineering San.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts - 6 th Edition Chapter 8: Relational Algebra.
CPSC 603 Database Systems Lecturer: Laurie Webster II, Ph.D., P.E.
Module 2: Intro to Relational Model
Databases Chapter 16.
Applied Discrete Mathematics Week 10: Relations
Hierarchy of Data in a Database
CSE 504 Discrete Structures & Foundations of Computer Science
Chapter (9) ER and EER-to-Relational Mapping, and other Relational Languages Objectives How a relational database schema can be created from a conceptual.
CS1222 Using Relational Databases and SQL
CMSC Discrete Structures
Chapter 2: Intro to Relational Model
Chapter (9) ER and EER-to-Relational Mapping, and other Relational Languages Objectives How a relational database schema can be created from a conceptual.
Discrete Math (2) Haiming Chen Associate Professor, PhD
Discrete Math (2) Haiming Chen Associate Professor, PhD
Discrete Math (2) Haiming Chen Associate Professor, PhD
Discrete Structures for Computer Science
Relational Databases The Relational Model.
Relational Databases The Relational Model.
CS2210 Discrete Structures Relations
الفصل الخامس قواعد البيانات Databases
Discrete Math (2) Haiming Chen Associate Professor, PhD
Discrete Math (2) Haiming Chen Associate Professor, PhD
Year 10 Homework Timetable History or Business Studies
Discrete Math (2) Haiming Chen Associate Professor, PhD
Applied Discrete Mathematics Week 6: Relations/Digraphs
Data Manipulation using Relational Algebra
Multiplying Integers SAME SIGNS??? Answer will be POSITIVE. ex)
Chapter 2: Intro to Relational Model
Chapter 2: Intro to Relational Model
CS1222 Using Relational Databases and SQL
CS1222 Using Relational Databases and SQL
Example of a Relation attributes (or columns) tuples (or rows)
Chapter 2: Intro to Relational Model
Discrete Math (2) Haiming Chen Associate Professor, PhD
Discrete Math (2) Haiming Chen Associate Professor, PhD
CS122B: Projects in Databases and Web Applications Spring 2018
CS122B: Projects in Databases and Web Applications Winter 2018
CS1222 Using Relational Databases and SQL
Week 6 LBSC 690 Information Technology
Chapter (7) ER-to-Relational Mapping, and other Relational Languages
CS122B: Projects in Databases and Web Applications Spring 2018
CS122B: Projects in Databases and Web Applications Winter 2018
CS1222 Using Relational Databases and SQL
Presentation transcript:

Discrete Math (2) Haiming Chen Associate Professor, PhD Department of Computer Science, Ningbo University http://www.chenhaiming.cn

n-ary Relations and Their Applications airline flight number {CA101, CZ203} starting point {BJ, SH, NB} destination {HZ, GZ, SZ} departure time {8:00, 12:00} arrival time {10:00, 15:00}

Examples N × N × N consisting of triples (a, b, c), where a, b, and c are integers with a < b < c Z × Z × Z consisting of all triples of integers (a, b, c), if and only if there is an integer k such that b = a + k and c = a + 2k Z × Z × Z+ , consisting of triples (a, b, m), where a, b, and m are integers with m ≥ 1 and a ≡ b (mod m) (A, N, S, D, T ) representing airplane flights, where A is the airline, N is the flight number, S is the starting point, D is the destination, and T is the departure time.

Databases and Relations the value of the n-tuple from this domain determines the n-tuple relational data model primary key Field/ attribute record (Stevens, 786576, Psychology, 2.99) n-tuples composite key

Operations on n-ary Relations form new n-ary relations

Operations on n-ary Relations Selection operator answer queries on databases that ask for all n-tuples that satisfy certain conditions find the records of all computer science majors who have a grade point average above 3.5.

Operations on n-ary Relations Projection maps the n-tuple (a1, a2, . . . , an) to the m-tuple (ai1 , ai2, . . . , aim), where m ≤ n. P1,4 P1,2

Operations on n-ary Relations Join produces a new relation from two relations by combining all m-tuples of the first relation with all n-tuples of the second relation, where the last p components of the m-tuples agree with the first p components of the n-tuples J2

SQL Structured Query Language

SQL P1,5 J2

Homework Page 590, Ex.28, 29