CS5300 Database Systems

Size: px
Start display at page:

Download "CS5300 Database Systems"

Transcription

1 CS5300 Database Systems Relational Algebra A.R. Hurson 323 CS Building

2 This module is intended to introduce: relational algebra as the backbone of relational model, and set of operations defined within the scope of relational model. 2

3 Note, this unit will be covered in two lectures. In case you finish it earlier, then you have the following options: 1) Take the early test and start CS5300.module3 2) Study the supplement module (supplement CS5300.module2) 3) Act as a helper to help other students in studying CS5300.module2 Note, options 2 and 3 have extra credits as noted in course outline. 3

4 Enforcement of background Current Module { Glossary of prerequisite topics No Familiar with the topics? Yes Take Test No Pass? Remedial action Yes { Glossary of topics No Familiar with the topics? Take the Module Yes Take Test No Pass? Yes Options Study next module? Review CS5300.module2.background Lead a group of students in this module (extra credits)? Study more advanced related topics (extra credits)? At the end: take exam, record the score, impose remedial action if not successful 4 Extra Curricular activities

5 You are expected to be familiar with: Relational data model Basic operations in relational model If not, you need to study CS5300.module2.background 5

6 Relational Algebra Relational model is based on set theory. relation is simply a set. The relational algebra is a set of high level operators that operate on relations. Each relational operator assumes one or two relations as input (unary or binary operators) and produces a relation as output. Relational algebra is composed of eight operators divided into two groups. A 6

7 Relational Algebra The traditional set operations: UNION, INTERSECTION, DIFFERENCE, and CARTESIAN PRODUCT. The special relational operations: RESTRICT, PROJECT, JOIN, and DIVIDE. 7

8 Relational Algebra Two relations are called Union-compatible if and only if they have identical headings, more precisely; They have the same set of attributes, and Corresponding attributes are defined on the same domain. Union, Intersection, and Difference require their operands to be union-compatible. 8

9 Set Operation Union: The union of two union-compatible relations A and B is a relation with the same heading as A and B (same schema) and a body consisting of the set of all tuples t belonging to either A or B (or both). A B = {t t A or t B} 9

10 Set Operation Intersection: Intersection of two unioncompatible relations A and B is a relation with the same heading as each of A and B (same schema) and with a body consisting of the set of the tuples t belonging to both A and B. A B = {t t A and t B} 10

11 Set Operation Difference: Difference between two unioncompatible relations A and B is a relation with the same heading as A and B (same schema) and with a body consisting of the set of tuples belonging to A and not to B. A B = {t t A and t B} 11

12 Set Operation Cartesian Product: Cartesian product of two product-compatible (disjoint headings) relations A and B, is a relation with a heading that is the coalescing of the headings of A and B (concatenated schemas) and a body consisting of the set of tuples t such that t is the concatenation of a tuple a from A and a tuple b from B. A Χ B = {<a,b> a A and b B} 12

13 Assume the following two relations: A S# SNAME STATUS CITY S1 Smith 20 London S4 Clark 20 London B S# SNAME STATUS CITY S1 Smith 20 London S2 Jones 10 Paris 13

14 A B = S# SNAME STATUS CITY S1 Smith 20 London S4 Clark 20 London S2 Jones 10 Paris A B = S# SNAME STATUS CITY S1 Smith 20 London A B = S# SNAME STATUS CITY S4 Clark 20 London 14

15 Set Operation Union, Intersect, and Product are associative operations; Union, Intersect, and Product are commutative operations; however, A (B C) (A B) C A B B A A B B A 15

16 Special Relational Operations Restriction (Select): Let θ {=, <, >,,...}, the θ-restriction of relation A on attributes X and Y is a relation with the same heading as A and a body consisting of the set of all tuples t in A that satisfy X θ Y. σ X θ Y (A) = {t t A and (t x θ t y is true)} θ-restriction effectively yields a horizontal subset of a given relation. 16

17 S S# Sname Status City S 1 Smith 20 London S 2 Jones 10 Paris S 3 Blake 30 Paris S 4 Clark 20 London S 5 Adams 30 Athens P P# Pname Color Weight City P 1 Nut Red 12 London P 2 Bolt Green 17 Paris P 3 Screw Blue 17 Rome P 4 Screw Red 14 London P 5 Cam Blue 12 Paris P 6 Cog Red 19 London 17

18 σ city= London (S) = S# Sname Status City S 1 Smith 20 London S 4 Clark 20 London σ Weight < 14 (P) = P# Pname Color Weight City P 1 Nut Red 12 London P 5 Cam Blue 12 Paris 18

19 Special Relational Operations Projection: Projection of a relation A on attributes X, Y,., is a relation with the heading of (X, Y, ) and a body consisting of all tuples (X:x, Y:y, ) such that a tuple t in A with the same X-value x, Y-value y, Π (X,Y, ) (A) = {r r x = t x, r y = t y, and t A } Projection operator effectively yields vertical slice of a given relation. 19

20 Π (City) (S) = City London Paris Athens Π (Color, City) (P) = Color City Red London Green Paris Blue Rome Blue Paris 20

21 Special Relational Operations Join (restrictive Cartesian product): Join operation comes in several variations: Natural Join θ-join Outer Join A c B = σ c (A Χ B) 21

22 Natural Join: Natural join of two relations A and B is a relation consisting of tuples t = <a, b> such that a is a tuple of A and b is a tuple of B and the common attribute values of A and B are equal Equijoin on all common fields. A c B = { <a,b> a A, b B, and a c =b c } Natural join is both associative and commutative. 22

23 θ-join: Let relations A and B be productcompatible (no attribute names in common) and let θ {<, >,,...}, then the θ-join of relation A on attribute X with relation B on attribute Y is a relation consist of tuples t from Cartesian product of A and B such that t x θ t y is true. A θ B = { <a,b> <a,b> A Χ B, and a X θ b Y is true} 23

24 A S.City=P.City B S# Sname Status S.City P# Pname Color Weight P.City S 1 Smith 20 London P 1 Nut Red 12 London S 1 Smith 20 London P 4 Screw Red 14 London S 1 Smith 20 London P 6 Cog Red 19 London S 2 Jones 10 Paris P 2 Bolt Green 17 Paris S 2 Jones 10 Paris P 5 Cam Blue 12 Paris S 3 Blake 30 Paris P 2 Bolt Green 17 Paris S 3 Blake 30 Paris P 5 Cam Blue 12 Paris S 4 Clark 20 London P 1 Nut Red 12 London S 4 Clark 20 London P 4 Screw Red 14 London S 4 Clark 20 London P 6 Cog Red 19 London 24

25 Division: Let A and B be two relations where set of B attributes are included in the one of A A (X 1, X 2,., X m, Y 1, Y 2,, Y n ) and B (Y 1, Y 2,, Y n ), then A B is a relation with the heading (X) and a body of the set of all tuples (X;x) such that (X:x, Y:y) is in A for all tuples (Y:y) in B. A B = { <a (X)> <a,b> A, <b> B} 25

26 Consider the following relations: A S# P# S1 S1 S1 S1 S1 S1 S2 S2 S3 S4 S4 S4 P1 P2 P3 P4 P5 P6 P1 P2 P2 P2 P4 P5 B B P# P1 P# P2 P4 B P# P1 P2 P3 P4 P5 P6 26

27 A B = S# S1 S2 A B = S# S1 S4 A B = S# S1 A S# P# S1 S1 S1 S1 S1 S1 S2 S2 S3 S4 S4 S4 P1 P2 P3 P4 P5 P6 P1 P2 P2 P2 P4 P5 B B B P# P1 P# P2 P4 P# P1 P2 P3 P4 P5 P6 27

28 Missing Information The problem of missing or unknown information is a very important data base issue. Information is very often incomplete. So we need a way of defining such incompleteness and a way to manipulate incomplete data bases. Discussion of the use of the Universal relation assumption has also increased interest in dealing with null values. A special column value called null ( ) is used to represent incomplete data. 28

29 Missing Information A partial tuple is one that contains one or more null values ( ). A tuple t is said to be total (t ) if and only if it contains no null values. This definition can be extended to relations as well. A relation A is total (A ) if all of its tuples are total. Relational operations using a search condition to select tuples will be basically affected by the incomplete data. 29

30 Missing Information Codd proposed the concept of three-valued logic as the basis to manipulate null values. Three-valued logic NOT T ω F F ω T AND T ω F T T ω F ω ω ω F F F F F OR T ω F T T T T ω T ω ω F T ω F 30

31 Maybe Algebra A truth-valued (logic) expression has the value of ω if and only if: Each occurrence of a null value in the expression can be replaced by a non-null value so as to yield the truth value T for the expression. Each occurrence of a null value in the expression can be replaced by a non-null value so as to yield the truth value F for the expression. 31

32 Maybe Algebra Assume the following two relations r(r) A B C r a 1 b 1 1 a 2 b 2 a 3 b 3 2 s(s) C s D 1 d 1 d 2 32

33 True Select r when C=1: A B C r a 1 b 1 1 r(r) Maybe Select r when C=1: A B C r a 1 b 1 1 a 2 b 2 a 3 b 3 2 A B C r a 2 b 2 33

34 True Join r and s over C: A B C r C s D a 1 b d 1 Maybe Join r and s over C: A B C r C s D a 1 b 1 1 d 2 a 2 b 2 1 d 1 a 2 b 2 d 2 a 3 b 3 2 d 2 r(r) s(s) A B C r a 1 b 1 1 a 2 b 2 a 3 b 3 2 C s D 1 d 1 d 2 34

35 Maybe Division: relations: Assume the following two r(r) A B C a 1 b 1 c 1 a 2 b 1 c 1 a 1 b 2 c 2 a 2 b 2 s(s) B C b 1 c 1 b 2 c 2 35

36 True Division (r s): A a 1 Maybe Division (r s): A a 2 r(r) s(s) A B C a 1 b 1 c 1 a 2 b 1 c 1 a 1 b 2 c 2 a 2 b 2 B C b 1 c 1 b 2 c 2 36

37 A somewhat different views of the null value is taken for the remaining relational algebra operations. For these operations, null values in different tuples are interpreted as being equivalent. Therefore, there is no changing in these operations over their use in traditional relational algebra. r(r) A B C Π (A,B) r A B a 1 c 1 a 1 a 1 c 2 a 2 b 2 a 2 b 2 a a 3 b 3 c 3 b

38 Missing Information Concept of null values can be used to bring the so-called dangling tuples into the join process and make relations union-compatible. 38

39 Outer Join θ : This is a direct consequence of dealing with incompleteness. In outer join, tuples in the join relations that do not match the join condition, will be extended by nulls and appear in the resultant relation. There are several variation of outer join: Left outer join right outer join full outer join 39

40 Outer Join r(a,b) and s(c,d) over B θ C (B and C are defined over the same domain and θ is the test condition) is defined as follows: r θ s = T (R 1 Χ (C :, D : )) ((A :, B : ) Χ S 1 ) Where: T is the true Join of r and s over B θ C, R 1 = r Π (A,B) (T) S 1 = s Π (C,D) (T) 40

41 Outer Join: An example, assume θ is equality, and r A B a 1 b 1 a 2 b 2 a 3 b 3 s C D b 1 d 1 b 2 d 2 b 4 d 3 41

42 r θ s = T (R 1 Χ (C :, D : )) ((A :, B : ) Χ S 1 ) R 1 = r Π (A,B) (T) S 1 = s Π (C,D) (T) T R 1 S 1 A B C D a 1 b 1 b 1 d 1 a 2 b 2 b 2 d 2 A B a 3 b 3 C D b 4 d 3 r θ s A B C D a 1 b 1 b 1 d 1 a 2 b 2 b 2 d 2 a 3 b 3 b 4 d 3 42

43 Assume the following relations: Sailors(sid:integer, sname:string, rating:integer, age:real) Boats(bid:integer, bname:string, color:string) Reserves(sid:integer, bid:integer, day:date) 43

44 1 04 Database Systems Sailors sid sname rating age 22 Dustin Burton Lubber Andy Rusty Horatio Zorba Horatio Art Bob Boats bid bname color 101 Interlake Blue 102 Interlake Red 103 Clipper Green 104 Marine red 44

45 Reserved sid bid day /10/ /10/ /8/ /7/ /10/ /6/ /12/ /5/ /8/ /8/98 45

46 Find names of sailors who have reserved a red boat Π sname (( σ color= red Boats) Reserves Sailors) sname Dustin Lubber Horatio 46

47 A more efficient solution would do the projections as early as possible: Π sname (Π sid ( (Π bid (σ color= red Boats) ) Reserves) Sailors) 47

48 Questions Find sailors that have reserved a green boat and a red boat. Identify sailors reserving red boats Identify sailors reserving green boats Intersect the sets and determine the sailors name What are the names of the sailors with the lowest rating (whatever that rating is). Compare the rating of each sailor with that of every other sailor Result is the set of sailors that never come out on top in one of these comparisons. 48

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

Database Systems Relational Algebra. A.R. Hurson 323 CS Building Relational Algebra A.R. Hurson 323 CS Building Relational Algebra Relational model is based on set theory. A relation is simply a set. The relational algebra is a set of high level operators that operate

More information

Database Systems SQL. A.R. Hurson 323 CS Building

Database Systems SQL. A.R. Hurson 323 CS Building SQL A.R. Hurson 323 CS Building Structured Query Language (SQL) The SQL language has the following features as well: Embedded and Dynamic facilities to allow SQL code to be called from a host language

More information

Relational Algebra and Calculus

Relational Algebra and Calculus Topics Relational Algebra and Calculus Linda Wu Formal query languages Preliminaries Relational algebra Relational calculus Expressive power of algebra and calculus (CMPT 354 2004-2) Chapter 4 CMPT 354

More information

Introduction to Data Management. Lecture #12 (Relational Algebra II)

Introduction to Data Management. Lecture #12 (Relational Algebra II) Introduction to Data Management Lecture #12 (Relational Algebra II) Instructor: Mike Carey mjcarey@ics.uci.edu Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1 Announcements v HW and exams:

More information

Relational Algebra & Calculus

Relational Algebra & Calculus Relational Algebra & Calculus Yanlei Diao UMass Amherst Slides Courtesy of R. Ramakrishnan and J. Gehrke 1 Outline v Conceptual Design: ER model v Logical Design: ER to relational model v Querying and

More information

Database Applications (15-415)

Database Applications (15-415) Database Applications (15-415) Relational Calculus Lecture 5, January 27, 2014 Mohammad Hammoud Today Last Session: Relational Algebra Today s Session: Relational algebra The division operator and summary

More information

Relational Algebra 2. Week 5

Relational Algebra 2. Week 5 Relational Algebra 2 Week 5 Relational Algebra (So far) Basic operations: Selection ( σ ) Selects a subset of rows from relation. Projection ( π ) Deletes unwanted columns from relation. Cross-product

More information

Databases 2011 The Relational Algebra

Databases 2011 The Relational Algebra Databases 2011 Christian S. Jensen Computer Science, Aarhus University What is an Algebra? An algebra consists of values operators rules Closure: operations yield values Examples integers with +,, sets

More information

But RECAP. Why is losslessness important? An Instance of Relation NEWS. Suppose we decompose NEWS into: R1(S#, Sname) R2(City, Status)

But RECAP. Why is losslessness important? An Instance of Relation NEWS. Suppose we decompose NEWS into: R1(S#, Sname) R2(City, Status) So far we have seen: RECAP How to use functional dependencies to guide the design of relations How to modify/decompose relations to achieve 1NF, 2NF and 3NF relations But How do we make sure the decompositions

More information

Tuple Relational Calculus

Tuple Relational Calculus Tuple Relational Calculus Université de Mons (UMONS) May 14, 2018 Motivation S[S#, SNAME, STATUS, CITY] P[P#, PNAME, COLOR, WEIGHT, CITY] SP[S#, P#, QTY)] Get all pairs of city names such that a supplier

More information

Plan of the lecture. G53RDB: Theory of Relational Databases Lecture 2. More operations: renaming. Previous lecture. Renaming.

Plan of the lecture. G53RDB: Theory of Relational Databases Lecture 2. More operations: renaming. Previous lecture. Renaming. Plan of the lecture G53RDB: Theory of Relational Lecture 2 Natasha Alechina chool of Computer cience & IT nza@cs.nott.ac.uk Renaming Joins Definability of intersection Division ome properties of relational

More information

Constraints: Functional Dependencies

Constraints: Functional Dependencies Constraints: Functional Dependencies Fall 2017 School of Computer Science University of Waterloo Databases CS348 (University of Waterloo) Functional Dependencies 1 / 42 Schema Design When we get a relational

More information

Database Design and Normalization

Database Design and Normalization Database Design and Normalization Chapter 11 (Week 12) EE562 Slides and Modified Slides from Database Management Systems, R. Ramakrishnan 1 1NF FIRST S# Status City P# Qty S1 20 London P1 300 S1 20 London

More information

Constraints: Functional Dependencies

Constraints: Functional Dependencies Constraints: Functional Dependencies Spring 2018 School of Computer Science University of Waterloo Databases CS348 (University of Waterloo) Functional Dependencies 1 / 32 Schema Design When we get a relational

More information

Introduction to Data Management. Lecture #7 (Relational DB Design Theory II)

Introduction to Data Management. Lecture #7 (Relational DB Design Theory II) Introduction to Data Management Lecture #7 (Relational DB Design Theory II) Instructor: Mike Carey mjcarey@ics.uci.edu Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1 Announcements v Homework

More information

Relational Algebra Part 1. Definitions.

Relational Algebra Part 1. Definitions. .. Cal Poly pring 2016 CPE/CC 365 Introduction to Database ystems Alexander Dekhtyar Eriq Augustine.. elational Algebra Notation, T,,... relations. t, t 1, t 2,... tuples of relations. t (n tuple with

More information

CS 4604: Introduc0on to Database Management Systems. B. Aditya Prakash Lecture #3: SQL---Part 1

CS 4604: Introduc0on to Database Management Systems. B. Aditya Prakash Lecture #3: SQL---Part 1 CS 4604: Introduc0on to Database Management Systems B. Aditya Prakash Lecture #3: SQL---Part 1 Announcements---Project Goal: design a database system applica=on with a web front-end Project Assignment

More information

Introduction to Data Management. Lecture #6 (Relational DB Design Theory)

Introduction to Data Management. Lecture #6 (Relational DB Design Theory) Introduction to Data Management Lecture #6 (Relational DB Design Theory) Instructor: Mike Carey mjcarey@ics.uci.edu Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1 Announcements v Homework

More information

Lecture #7 (Relational Design Theory, cont d.)

Lecture #7 (Relational Design Theory, cont d.) Introduction to Data Management Lecture #7 (Relational Design Theory, cont d.) Instructor: Mike Carey mjcarey@ics.uci.edu Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1 Announcements

More information

INF1383 -Bancos de Dados

INF1383 -Bancos de Dados INF1383 -Bancos de Dados Prof. Sérgio Lifschitz DI PUC-Rio Eng. Computação, Sistemas de Informação e Ciência da Computação Projeto de BD e Formas Normais Alguns slides são baseados ou modificados dos originais

More information

CS54100: Database Systems

CS54100: Database Systems CS54100: Database Systems Relational Algebra 3 February 2012 Prof. Walid Aref Core Relational Algebra A small set of operators that allow us to manipulate relations in limited but useful ways. The operators

More information

Database Applications (15-415)

Database Applications (15-415) Database Applications (15-415) Relational Calculus Lecture 6, January 26, 2016 Mohammad Hammoud Today Last Session: Relational Algebra Today s Session: Relational calculus Relational tuple calculus Announcements:

More information

Schedule. Today: Jan. 17 (TH) Jan. 24 (TH) Jan. 29 (T) Jan. 22 (T) Read Sections Assignment 2 due. Read Sections Assignment 3 due.

Schedule. Today: Jan. 17 (TH) Jan. 24 (TH) Jan. 29 (T) Jan. 22 (T) Read Sections Assignment 2 due. Read Sections Assignment 3 due. Schedule Today: Jan. 17 (TH) Relational Algebra. Read Chapter 5. Project Part 1 due. Jan. 22 (T) SQL Queries. Read Sections 6.1-6.2. Assignment 2 due. Jan. 24 (TH) Subqueries, Grouping and Aggregation.

More information

BOOLEAN ALGEBRA INTRODUCTION SUBSETS

BOOLEAN ALGEBRA INTRODUCTION SUBSETS BOOLEAN ALGEBRA M. Ragheb 1/294/2018 INTRODUCTION Modern algebra is centered around the concept of an algebraic system: A, consisting of a set of elements: ai, i=1, 2,, which are combined by a set of operations

More information

COSC 430 Advanced Database Topics. Lecture 2: Relational Theory Haibo Zhang Computer Science, University of Otago

COSC 430 Advanced Database Topics. Lecture 2: Relational Theory Haibo Zhang Computer Science, University of Otago COSC 430 Advanced Database Topics Lecture 2: Relational Theory Haibo Zhang Computer Science, University of Otago Learning objectives and references You should be able to: define the elements of the relational

More information

UVA UVA UVA UVA. Database Design. Relational Database Design. Functional Dependency. Loss of Information

UVA UVA UVA UVA. Database Design. Relational Database Design. Functional Dependency. Loss of Information Relational Database Design Database Design To generate a set of relation schemas that allows - to store information without unnecessary redundancy - to retrieve desired information easily Approach - design

More information

CAS CS 460/660 Introduction to Database Systems. Functional Dependencies and Normal Forms 1.1

CAS CS 460/660 Introduction to Database Systems. Functional Dependencies and Normal Forms 1.1 CAS CS 460/660 Introduction to Database Systems Functional Dependencies and Normal Forms 1.1 Review: Database Design Requirements Analysis user needs; what must database do? Conceptual Design high level

More information

Mathematics Review for Business PhD Students

Mathematics Review for Business PhD Students Mathematics Review for Business PhD Students Anthony M. Marino Department of Finance and Business Economics Marshall School of Business Lecture 1: Introductory Material Sets The Real Number System Functions,

More information

Automata and Languages

Automata and Languages Automata and Languages Prof. Mohamed Hamada Software Engineering Lab. The University of Aizu Japan Mathematical Background Mathematical Background Sets Relations Functions Graphs Proof techniques Sets

More information

Discrete Mathematics. CS204: Spring, Jong C. Park Computer Science Department KAIST

Discrete Mathematics. CS204: Spring, Jong C. Park Computer Science Department KAIST Discrete Mathematics CS204: Spring, 2008 Jong C. Park Computer Science Department KAIST Today s Topics Combinatorial Circuits Properties of Combinatorial Circuits Boolean Algebras Boolean Functions and

More information

CS 121 Digital Logic Design. Chapter 2. Teacher Assistant. Hanin Abdulrahman

CS 121 Digital Logic Design. Chapter 2. Teacher Assistant. Hanin Abdulrahman CS 121 Digital Logic Design Chapter 2 Teacher Assistant Hanin Abdulrahman 1 2 Outline 2.2 Basic Definitions 2.3 Axiomatic Definition of Boolean Algebra. 2.4 Basic Theorems and Properties 2.5 Boolean Functions

More information

Mathematics Review for Business PhD Students Lecture Notes

Mathematics Review for Business PhD Students Lecture Notes Mathematics Review for Business PhD Students Lecture Notes Anthony M. Marino Department of Finance and Business Economics Marshall School of Business University of Southern California Los Angeles, CA 90089-0804

More information

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products Chapter 3 Cartesian Products and Relations The material in this chapter is the first real encounter with abstraction. Relations are very general thing they are a special type of subset. After introducing

More information

CA320 - Computability & Complexity

CA320 - Computability & Complexity CA320 - Computability & Complexity David Sinclair Overview In this module we are going to answer 2 important questions: Can all problems be solved by a computer? What problems be efficiently solved by

More information

Chapter 3 Relational Model

Chapter 3 Relational Model Chapter 3 Relational Model Table of Contents 1. Structure of Relational Databases 2. Relational Algebra 3. Tuple Relational Calculus 4. Domain Relational Calculus Chapter 3-1 1 1. Structure of Relational

More information

Sets with Partial Memberships A Rough Set View of Fuzzy Sets

Sets with Partial Memberships A Rough Set View of Fuzzy Sets Sets with Partial Memberships A Rough Set View of Fuzzy Sets T. Y. Lin Department of Mathematics and Computer Science San Jose State University San Jose, California 95192-0103 E-mail: tylin@cs.sjsu.edu

More information

COMP9020 Lecture 3 Session 2, 2014 Sets, Functions, and Sequences. Revision: 1.3

COMP9020 Lecture 3 Session 2, 2014 Sets, Functions, and Sequences. Revision: 1.3 1 COMP9020 Lecture 3 Session 2, 2014 Sets, Functions, and Sequences Revision: 1.3 2 Notation for Numbers Definition Integers Z = {... 2, 1, 0, 1, 2,...} Reals R. : R Z floor of x, the greatest integer

More information

Mathematics Foundation for College. Lesson Number 1. Lesson Number 1 Page 1

Mathematics Foundation for College. Lesson Number 1. Lesson Number 1 Page 1 Mathematics Foundation for College Lesson Number 1 Lesson Number 1 Page 1 Lesson Number 1 Topics to be Covered in this Lesson Sets, number systems, axioms, arithmetic operations, prime numbers and divisibility,

More information

Sets and Motivation for Boolean algebra

Sets and Motivation for Boolean algebra SET THEORY Basic concepts Notations Subset Algebra of sets The power set Ordered pairs and Cartesian product Relations on sets Types of relations and their properties Relational matrix and the graph of

More information

Review CHAPTER. 2.1 Definitions in Chapter Sample Exam Questions. 2.1 Set; Element; Member; Universal Set Partition. 2.

Review CHAPTER. 2.1 Definitions in Chapter Sample Exam Questions. 2.1 Set; Element; Member; Universal Set Partition. 2. CHAPTER 2 Review 2.1 Definitions in Chapter 2 2.1 Set; Element; Member; Universal Set 2.2 Subset 2.3 Proper Subset 2.4 The Empty Set, 2.5 Set Equality 2.6 Cardinality; Infinite Set 2.7 Complement 2.8 Intersection

More information

1. SET 10/9/2013. Discrete Mathematics Fajrian Nur Adnan, M.CS

1. SET 10/9/2013. Discrete Mathematics Fajrian Nur Adnan, M.CS 1. SET 10/9/2013 Discrete Mathematics Fajrian Nur Adnan, M.CS 1 Discrete Mathematics 1. Set and Logic 2. Relation 3. Function 4. Induction 5. Boolean Algebra and Number Theory MID 6. Graf dan Tree/Pohon

More information

Relations. Relations of Sets N-ary Relations Relational Databases Binary Relation Properties Equivalence Relations. Reading (Epp s textbook)

Relations. Relations of Sets N-ary Relations Relational Databases Binary Relation Properties Equivalence Relations. Reading (Epp s textbook) Relations Relations of Sets N-ary Relations Relational Databases Binary Relation Properties Equivalence Relations Reading (Epp s textbook) 8.-8.3. Cartesian Products The symbol (a, b) denotes the ordered

More information

CSE 132B Database Systems Applications

CSE 132B Database Systems Applications CSE 132B Database Systems Applications Alin Deutsch Database Design and Normal Forms Some slides are based or modified from originals by Sergio Lifschitz @ PUC Rio, Brazil and Victor Vianu @ CSE UCSD and

More information

Fuzzy Sets and Systems. Lecture 4 (Fuzzy Logic) Bu- Ali Sina University Computer Engineering Dep. Spring 2010

Fuzzy Sets and Systems. Lecture 4 (Fuzzy Logic) Bu- Ali Sina University Computer Engineering Dep. Spring 2010 Fuzzy Sets and Systems Lecture 4 (Fuzzy Logic) Bu- Ali Sina University Computer Engineering Dep. Spring 2010 Outline Fuzzy Logic Classical logic- an overview Multi-valued logic Fuzzy logic Fuzzy proposition

More information

Instructor: Sudeepa Roy

Instructor: Sudeepa Roy CompSci 590.6 Understanding Data: Theory and Applications Lecture 13 Incomplete Databases Instructor: Sudeepa Roy Email: sudeepa@cs.duke.edu 1 Today s Reading Alice Book : Foundations of Databases Abiteboul-

More information

Functional Dependencies. Getting a good DB design Lisa Ball November 2012

Functional Dependencies. Getting a good DB design Lisa Ball November 2012 Functional Dependencies Getting a good DB design Lisa Ball November 2012 Outline (2012) SEE NEXT SLIDE FOR ALL TOPICS (some for you to read) Normalization covered by Dr Sanchez Armstrong s Axioms other

More information

Notes on Sets for Math 10850, fall 2017

Notes on Sets for Math 10850, fall 2017 Notes on Sets for Math 10850, fall 2017 David Galvin, University of Notre Dame September 14, 2017 Somewhat informal definition Formally defining what a set is is one of the concerns of logic, and goes

More information

Lecture 6: Manipulation of Algebraic Functions, Boolean Algebra, Karnaugh Maps

Lecture 6: Manipulation of Algebraic Functions, Boolean Algebra, Karnaugh Maps EE210: Switching Systems Lecture 6: Manipulation of Algebraic Functions, Boolean Algebra, Karnaugh Maps Prof. YingLi Tian Feb. 21/26, 2019 Department of Electrical Engineering The City College of New York

More information

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska LECTURE 1 Course Web Page www3.cs.stonybrook.edu/ cse303 The webpage contains: lectures notes slides; very detailed solutions to

More information

Boolean Algebra & Logic Gates. By : Ali Mustafa

Boolean Algebra & Logic Gates. By : Ali Mustafa Boolean Algebra & Logic Gates By : Ali Mustafa Digital Logic Gates There are three fundamental logical operations, from which all other functions, no matter how complex, can be derived. These Basic functions

More information

Mathematics: Year 12 Transition Work

Mathematics: Year 12 Transition Work Mathematics: Year 12 Transition Work There are eight sections for you to study. Each section covers a different skill set. You will work online and on paper. 1. Manipulating directed numbers and substitution

More information

CSE 562 Database Systems

CSE 562 Database Systems Outline Query Optimization CSE 562 Database Systems Query Processing: Algebraic Optimization Some slides are based or modified from originals by Database Systems: The Complete Book, Pearson Prentice Hall

More information

CHAPTER 1. Preliminaries. 1 Set Theory

CHAPTER 1. Preliminaries. 1 Set Theory CHAPTER 1 Preliminaries 1 et Theory We assume that the reader is familiar with basic set theory. In this paragraph, we want to recall the relevant definitions and fix the notation. Our approach to set

More information

Relational Design: Characteristics of Well-designed DB

Relational Design: Characteristics of Well-designed DB Relational Design: Characteristics of Well-designed DB 1. Minimal duplication Consider table newfaculty (Result of F aculty T each Course) Id Lname Off Bldg Phone Salary Numb Dept Lvl MaxSz 20000 Cotts

More information

Course: Algebra 1-A Direct link to this page:http://www.floridastandards.org/courses/publicpreviewcourse5.aspx?ct=1

Course: Algebra 1-A Direct link to this page:http://www.floridastandards.org/courses/publicpreviewcourse5.aspx?ct=1 Course: 1200370 Algebra 1-A Direct link to this page:http://www.floridastandards.org/courses/publicpreviewcourse5.aspx?ct=1 BASIC INFORMATION Course Number: 1200370 Course Title: Algebra 1-A Course Abbreviated

More information

Axioms of Kleene Algebra

Axioms of Kleene Algebra Introduction to Kleene Algebra Lecture 2 CS786 Spring 2004 January 28, 2004 Axioms of Kleene Algebra In this lecture we give the formal definition of a Kleene algebra and derive some basic consequences.

More information

Introduction to Data Management. Lecture #6 (Relational Design Theory)

Introduction to Data Management. Lecture #6 (Relational Design Theory) Introduction to Data Management Lecture #6 (Relational Design Theory) Instructor: Mike Carey mjcarey@ics.uci.edu Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1 Announcements v HW#2 is

More information

General Overview - rel. model. Carnegie Mellon Univ. Dept. of Computer Science /615 DB Applications. Motivation. Overview - detailed

General Overview - rel. model. Carnegie Mellon Univ. Dept. of Computer Science /615 DB Applications. Motivation. Overview - detailed Carnegie Mellon Univ. Dep of Computer Science 15-415/615 DB Applications C. Faloutsos & A. Pavlo Lecture#5: Relational calculus General Overview - rel. model history concepts Formal query languages relational

More information

Relational completeness of query languages for annotated databases

Relational completeness of query languages for annotated databases Relational completeness of query languages for annotated databases Floris Geerts 1,2 and Jan Van den Bussche 1 1 Hasselt University/Transnational University Limburg 2 University of Edinburgh Abstract.

More information

CS 186, Fall 2002, Lecture 6 R&G Chapter 15

CS 186, Fall 2002, Lecture 6 R&G Chapter 15 Schema Refinement and Normalization CS 186, Fall 2002, Lecture 6 R&G Chapter 15 Nobody realizes that some people expend tremendous energy merely to be normal. Albert Camus Functional Dependencies (Review)

More information

( ) y 2! 4. ( )( y! 2)

( ) y 2! 4. ( )( y! 2) 1. Dividing: 4x3! 8x 2 + 6x 2x 5.7 Division of Polynomials = 4x3 2x! 8x2 2x + 6x 2x = 2x2! 4 3. Dividing: 1x4 + 15x 3! 2x 2!5x 2 = 1x4!5x 2 + 15x3!5x 2! 2x2!5x 2 =!2x2! 3x + 4 5. Dividing: 8y5 + 1y 3!

More information

9/19/2018. Cartesian Product. Cartesian Product. Partitions

9/19/2018. Cartesian Product. Cartesian Product. Partitions Cartesian Product The ordered n-tuple (a 1, a 2, a 3,, a n ) is an ordered collection of objects. Two ordered n-tuples (a 1, a 2, a 3,, a n ) and (b 1, b 2, b 3,, b n ) are equal if and only if they contain

More information

Lecture 12. Statement Logic as a word algebra on the set of atomic statements. Lindenbaum algebra.

Lecture 12. Statement Logic as a word algebra on the set of atomic statements. Lindenbaum algebra. V. Borschev and B. Partee, October 26, 2006 p. 1 Lecture 12. Statement Logic as a word algebra on the set of atomic statements. Lindenbaum algebra. 0. Preliminary notes...1 1. Freedom for algebras. Word

More information

Lecture 4. Algebra, continued Section 2: Lattices and Boolean algebras

Lecture 4. Algebra, continued Section 2: Lattices and Boolean algebras V. Borschev and B. Partee, September 21-26, 2006 p. 1 Lecture 4. Algebra, continued Section 2: Lattices and Boolean algebras CONTENTS 1. Lattices.... 1 1.0. Why lattices?... 1 1.1. Posets... 1 1.1.1. Upper

More information

Boolean Algebra CHAPTER 15

Boolean Algebra CHAPTER 15 CHAPTER 15 Boolean Algebra 15.1 INTRODUCTION Both sets and propositions satisfy similar laws, which are listed in Tables 1-1 and 4-1 (in Chapters 1 and 4, respectively). These laws are used to define an

More information

CS2742 midterm test 2 study sheet. Boolean circuits: Predicate logic:

CS2742 midterm test 2 study sheet. Boolean circuits: Predicate logic: x NOT ~x x y AND x /\ y x y OR x \/ y Figure 1: Types of gates in a digital circuit. CS2742 midterm test 2 study sheet Boolean circuits: Boolean circuits is a generalization of Boolean formulas in which

More information

From Constructibility and Absoluteness to Computability and Domain Independence

From Constructibility and Absoluteness to Computability and Domain Independence From Constructibility and Absoluteness to Computability and Domain Independence Arnon Avron School of Computer Science Tel Aviv University, Tel Aviv 69978, Israel aa@math.tau.ac.il Abstract. Gödel s main

More information

Introduction to first-order logic:

Introduction to first-order logic: Introduction to first-order logic: First-order structures and languages. Terms and formulae in first-order logic. Interpretations, truth, validity, and satisfaction. Valentin Goranko DTU Informatics September

More information

Schema Refinement. Feb 4, 2010

Schema Refinement. Feb 4, 2010 Schema Refinement Feb 4, 2010 1 Relational Schema Design Conceptual Design name Product buys Person price name ssn ER Model Logical design Relational Schema plus Integrity Constraints Schema Refinement

More information

3. Abstract Boolean Algebras

3. Abstract Boolean Algebras 3. ABSTRACT BOOLEAN ALGEBRAS 123 3. Abstract Boolean Algebras 3.1. Abstract Boolean Algebra. Definition 3.1.1. An abstract Boolean algebra is defined as a set B containing two distinct elements 0 and 1,

More information

Algebra I Classroom Guide

Algebra I Classroom Guide SkillsTutor Algebra I Classroom Guide Table of Contents Getting Started... 1 Algebra I Lessons... 2 Quizzes...2 Tests...2 Algebra I Lesson Summaries... 3 Equations, Inequalities, and Polynomials...4 Factoring

More information

1.9 Algebraic Expressions

1.9 Algebraic Expressions 1.9 Algebraic Expressions Contents: Terms Algebraic Expressions Like Terms Combining Like Terms Product of Two Terms The Distributive Property Distributive Property with a Negative Multiplier Answers Focus

More information

Characterizing the Equational Theory

Characterizing the Equational Theory Introduction to Kleene Algebra Lecture 4 CS786 Spring 2004 February 2, 2004 Characterizing the Equational Theory Most of the early work on Kleene algebra was directed toward characterizing the equational

More information

MATH 0409: Foundations of Mathematics COURSE OUTLINE

MATH 0409: Foundations of Mathematics COURSE OUTLINE MATH 0409: Foundations of Mathematics COURSE OUTLINE Spring 2016 CRN91085 MW 5:30-7:30pm AM209 Professor Sherri Escobar sherri.escobar@hccs.edu 281-620-1115 Catalog Description: Foundations of Mathematics.

More information

COMP9020 Lecture 3 Session 2, 2016 Sets, Functions, and Sequences. Revision: 1.3

COMP9020 Lecture 3 Session 2, 2016 Sets, Functions, and Sequences. Revision: 1.3 1 COMP9020 Lecture 3 Session 2, 2016 Sets, Functions, and Sequences Revision: 1.3 2 Divisibility Let m, n Z. m n means m is a divisor of n, defined by n = km for some k Z (Also stated as: n is divisible

More information

Chapter 0: Preliminaries

Chapter 0: Preliminaries Chapter 0: Preliminaries Adam Sheffer March 28, 2016 1 Notation This chapter briefly surveys some basic concepts and tools that we will use in this class. Graduate students and some undergrads would probably

More information

Packet #2: Set Theory & Predicate Calculus. Applied Discrete Mathematics

Packet #2: Set Theory & Predicate Calculus. Applied Discrete Mathematics CSC 224/226 Notes Packet #2: Set Theory & Predicate Calculus Barnes Packet #2: Set Theory & Predicate Calculus Applied Discrete Mathematics Table of Contents Full Adder Information Page 1 Predicate Calculus

More information

Incomplete Information in RDF

Incomplete Information in RDF Incomplete Information in RDF Charalampos Nikolaou and Manolis Koubarakis charnik@di.uoa.gr koubarak@di.uoa.gr Department of Informatics and Telecommunications National and Kapodistrian University of Athens

More information

Schema Refinement: Other Dependencies and Higher Normal Forms

Schema Refinement: Other Dependencies and Higher Normal Forms Schema Refinement: Other Dependencies and Higher Normal Forms Spring 2018 School of Computer Science University of Waterloo Databases CS348 (University of Waterloo) Higher Normal Forms 1 / 14 Outline 1

More information

Foundations of Mathematics

Foundations of Mathematics Foundations of Mathematics Andrew Monnot 1 Construction of the Language Loop We must yield to a cyclic approach in the foundations of mathematics. In this respect we begin with some assumptions of language

More information

A Theory and Calculus for Reasoning about Sequential Behavior

A Theory and Calculus for Reasoning about Sequential Behavior A Theory and Calculus for Reasoning about Sequential Behavior FREDERICK FURTEK Applied Combinatorics, Menlo Park, CA 94025 USA, fred@calculus.com Basic results in combinatorial mathematics provide the

More information

COURSE SYLLABUS Part I Course Title: MATH College Algebra Credit Hours: 4, (4 Lecture 0 Lab G) OTM-TMM001

COURSE SYLLABUS Part I Course Title: MATH College Algebra Credit Hours: 4, (4 Lecture 0 Lab G) OTM-TMM001 COURSE SYLLABUS Part I Course Title: MATH 1340 - College Algebra Credit Hours: 4, (4 Lecture 0 Lab G) OTM-TMM001 Course Description: College Algebra in conjunction with MATH 1350, Pre-Calculus, provides

More information

spaghetti fish pie cake Ann X X Tom X X X Paul X X X

spaghetti fish pie cake Ann X X Tom X X X Paul X X X CmSc175 Discrete Mathematics Lesson 14: Set Relations 1. Introduction A college cafeteria line has two stations: main courses and desserts. The main course station offers spaghetti or fish; the dessert

More information

PREFACE. Synergy for Success in Mathematics 7 is designed for Grade 7 students. The textbook

PREFACE. Synergy for Success in Mathematics 7 is designed for Grade 7 students. The textbook Synergy for Success in Mathematics 7 is designed for Grade 7 students. The textbook contains all the required learning competencies and is supplemented with some additional topics for enrichment. Lessons

More information

CMPS Advanced Database Systems. Dr. Chengwei Lei CEECS California State University, Bakersfield

CMPS Advanced Database Systems. Dr. Chengwei Lei CEECS California State University, Bakersfield CMPS 4420 Advanced Database Systems Dr. Chengwei Lei CEECS California State University, Bakersfield CHAPTER 15 Relational Database Design Algorithms and Further Dependencies Slide 15-2 Chapter Outline

More information

INTRODUCTION TO RELATIONAL DATABASE SYSTEMS

INTRODUCTION TO RELATIONAL DATABASE SYSTEMS INTRODUCTION TO RELATIONAL DATABASE SYSTEMS DATENBANKSYSTEME 1 (INF 3131) Torsten Grust Universität Tübingen Winter 2017/18 1 THE RELATIONAL ALGEBRA The Relational Algebra (RA) is a query language for

More information

SOME TRANSFINITE INDUCTION DEDUCTIONS

SOME TRANSFINITE INDUCTION DEDUCTIONS SOME TRANSFINITE INDUCTION DEDUCTIONS SYLVIA DURIAN Abstract. This paper develops the ordinal numbers and transfinite induction, then demonstrates some interesting applications of transfinite induction.

More information

Topics in Probabilistic and Statistical Databases. Lecture 2: Representation of Probabilistic Databases. Dan Suciu University of Washington

Topics in Probabilistic and Statistical Databases. Lecture 2: Representation of Probabilistic Databases. Dan Suciu University of Washington Topics in Probabilistic and Statistical Databases Lecture 2: Representation of Probabilistic Databases Dan Suciu University of Washington 1 Review: Definition The set of all possible database instances:

More information

MEASURE AND INTEGRATION: LECTURE 18

MEASURE AND INTEGRATION: LECTURE 18 MEASURE AND INTEGRATION: LECTURE 18 Fubini s theorem Notation. Let l and m be positive integers, and n = l + m. Write as the Cartesian product = +. We will write points in as z ; x ; y ; z = (x, y). If

More information

Undergraduate Notes in Mathematics. Arkansas Tech University Department of Mathematics. College Algebra for STEM

Undergraduate Notes in Mathematics. Arkansas Tech University Department of Mathematics. College Algebra for STEM Undergraduate Notes in Mathematics Arkansas Tech University Department of Mathematics College Algebra for STEM Marcel B. Finan c All Rights Reserved 2015 Edition To my children Amin & Nadia Preface From

More information

MATH 433 Applied Algebra Lecture 22: Semigroups. Rings.

MATH 433 Applied Algebra Lecture 22: Semigroups. Rings. MATH 433 Applied Algebra Lecture 22: Semigroups. Rings. Groups Definition. A group is a set G, together with a binary operation, that satisfies the following axioms: (G1: closure) for all elements g and

More information

COMP Logic for Computer Scientists. Lecture 16

COMP Logic for Computer Scientists. Lecture 16 COMP 1002 Logic for Computer Scientists Lecture 16 5 2 J dmin stuff 2 due Feb 17 th. Midterm March 2 nd. Semester break next week! Puzzle: the barber In a certain village, there is a (male) barber who

More information

Lecture : Set Theory and Logic

Lecture : Set Theory and Logic Lecture : Dr. Department of Mathematics Lovely Professional University Punjab, India October 18, 2014 Outline Contrapositive and Converse 1 Contrapositive and Converse 2 3 4 5 Contrapositive and Converse

More information

10/12/10. Outline. Schema Refinements = Normal Forms. First Normal Form (1NF) Data Anomalies. Relational Schema Design

10/12/10. Outline. Schema Refinements = Normal Forms. First Normal Form (1NF) Data Anomalies. Relational Schema Design Outline Introduction to Database Systems CSE 444 Design theory: 3.1-3.4 [Old edition: 3.4-3.6] Lectures 6-7: Database Design 1 2 Schema Refinements = Normal Forms 1st Normal Form = all tables are flat

More information

Query Processing. 3 steps: Parsing & Translation Optimization Evaluation

Query Processing. 3 steps: Parsing & Translation Optimization Evaluation rela%onal algebra Query Processing 3 steps: Parsing & Translation Optimization Evaluation 30 Simple set of algebraic operations on relations Journey of a query SQL select from where Rela%onal algebra π

More information

Chapter 8: Relational Database Design

Chapter 8: Relational Database Design Chapter 8: Relational Database Design Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Chapter 8: Relational Database Design Features of Good Relational Design Atomic Domains

More information

Sub-Queries in SQL SQL. 3 Types of Sub-Queries. 3 Types of Sub-Queries. Scalar Sub-Query Example. Scalar Sub-Query Example

Sub-Queries in SQL SQL. 3 Types of Sub-Queries. 3 Types of Sub-Queries. Scalar Sub-Query Example. Scalar Sub-Query Example SQL Sub-Queries in SQL Peter Y. Wu Department of Computer and Information Systems Robert Morris University Data Definition Language Create table for schema and constraints Drop table Data Manipulation

More information

Geometry 21 Summer Work Packet Review and Study Guide

Geometry 21 Summer Work Packet Review and Study Guide Geometry Summer Work Packet Review and Study Guide This study guide is designed to accompany the Geometry Summer Work Packet. Its purpose is to offer a review of the ten specific concepts covered in the

More information

2. Introduction to commutative rings (continued)

2. Introduction to commutative rings (continued) 2. Introduction to commutative rings (continued) 2.1. New examples of commutative rings. Recall that in the first lecture we defined the notions of commutative rings and field and gave some examples of

More information

DO NOT USE WITHOUT PERMISSION

DO NOT USE WITHOUT PERMISSION PROGRESSION FOR DEVELOPING ALGEBRA UNDERSTANDING THROUGH GENERALIZING ARITHMETIC ACROSS GRADES 3-7: This curricular progression is intended to develop algebra understanding through generalizing arithmetic.

More information