Query Processing. 3 steps: Parsing & Translation Optimization Evaluation

Size: px
Start display at page:

Download "Query Processing. 3 steps: Parsing & Translation Optimization Evaluation"

Transcription

1 rela%onal algebra

2 Query Processing 3 steps: Parsing & Translation Optimization Evaluation 30

3 Simple set of algebraic operations on relations Journey of a query SQL select from where Rela%onal algebra π 13 (P Q) Query rewri%ng π 14 (P S) Q R We use set seman/cs (no duplicates) and no nulls There are extensions with bag seman%cs and nulls 31

4 Projection Eliminate some columns π X (R) Display only attributes X of relation R where R: table name & X attributes(r) Example: Find titles of current movies π TITLE (SCHEDULE) 32

5 Projection Eliminate some columns π X (R) Display only attributes X of relation R where R: table name & X attributes(r) Example: R A B C π A (R) = A π AB (R) = A B No repetitions of tuples! 33

6 Selection Compute set union σ cond (R) Select tuples of R satisfying condition cond where cond: condition involving only attributes of R (e.g., attr = value, attr value, attr1 = attr2, attr1 attr2, etc.) Example: R A B C A B C σ Α=0 (R) = σ B=C (R) = A B C

7 Selection Compute set union σ cond (R) Select tuples of R satisfying condition cond where cond: condition involving only attributes of R (e.g., attr = value, attr value, attr1 = attr2, attr1 attr2, etc.) Example: R A B C A B C σ Α 0 (R) =

8 Union Compute set union R S Union of sets of tuples in R and S where R, S: tables with same attributes Example: R A B S A B R S = A B α 1 α 2 α 1 α 2 β 3 α 2 β 1 β 1 β 3 36

9 Difference Compute set difference R - S Difference of sets of tuples in R and S where R, S: tables with same attributes Example: R A B S A B R - S = A B α 1 α 2 α 1 α 2 β 3 β 1 β 1 37

10 Join Compute join R S Natural Join of R, S where R, S: tables Example: R A B S B C R S = A B C Note: More than one common attributes allowed! 38

11 Join Compute join R S Natural Join of R, S where R, S: tables Example: R A B S B C R S = A B C

12 Definition of Join Let r and s be relations on schemas R and S respectively. Then, r s is a relation with attributes att(r) att(s) obtained as follows: Consider each pair of tuples t r from r and t s from s. If t r and t s have the same value on each of the attributes in att(r) att(s), add a tuple t to the result, where t has the same value as t r on r t has the same value as t s on s Note: if R S is empty, the join consists of all combinations of tuples from R and S, i.e. their cross-product

13 Attribute Renaming Rename attributes δ A1 A2 (R) Change name of attribute A1 in rel. R to A2 where R: relation and A1: attribute in R Example: R A B δ A C (R) = C B α 1 α 1 α 2 α 2 β 1 β 1 Contents remain unchanged! Note: Can rename several attributes at once 41

14 Basic set of operations: π, σ,, -,, δ Back to movie example queries: 1. Titles of currently playing movies: π TITLE (schedule) 2. Titles of movies by Berto: π TITLE (σ DIR=BERTO (movie)) 3. Titles and directors of currently playing movies: π TITLE, DIR (movie schedule) 42

15 4. Find the pairs of actors acting together in some movie π actor1, actor2 (δ actor à actor1 (movie) δ actor à actor2 (movie)) 5. Find the actors playing in every movie by Berto π actor (movie) π actor [(π actor (movie) π title (σ dir =BERTO (movie))) - π actor,title (movie)] actor %tle by Berto actor acts in %tle actors for which there is a movie by Berto in which they do not act In this case (not in general): Same as cartesian product 43

16 Cartesian Product Compute cartesian product R S Cartesian Product of R, S where R, S: tables Example: R A B S C D R S = A B C D Same as R S, when R and S have no common attributes

17 Cartesian Product Compute cartesian product R S Cartesian Product of R, S where R, S: tables Example: R A B S A C R S = R.A B S.A C If 2 attributes in R, S have the same name A, they are renamed to R.A and S.A in the output

18 Other useful operations Intersection R S Division (Quotient) R S R A B S B R S: {a <a, b> R for every b S} Example: R A B S B R S = 0 α α 0 β β 1 α 1 β 1 γ 2 α Α

19 Another Division Example Find the actors playing in every movie by Berto" π TITLE, ACTOR (movie) π TITLE (σ DIR=BERTO (movie))

20 Division by multiple attributes Relations r, s:" r! A! B! C! D! E! s! D! E! α! α! α! β! β! γ! γ! γ! a! α! γ! γ! γ! γ! γ! γ! β! b" b" b" b! 1! 1! 1! 1! 3! 1! 1! 1! b! 1! 1! r s:" A! B! C! α! γ! a! γ! γ!

21 Note: π is like there exists is like for all Expressing using other operators: R S = π A (R) - π A ((π A (R) S) - R) R A B S B Similar to: x ϕ(x) x ϕ(x) 49

22 Join Operators Compute different types of joins R S R S R S R S R θ S Natural Join Left Outer Join Right Outer Join Full Outer Join Theta Join: Same as σ θ (R S) 50

23 Calculus Vs. Algebra Theorem: Calculus and Algebra are equivalent Basic Correspondence: Algebra Operation π σ - Calculus Operation t(a) comp c 51

24 Example Find theaters showing movies by Bertolucci : SQL: SELECT s.theater FROM schedule s, movie m WHERE s.title = m.title AND m.director = Berto tuple calculus: { t: theater s schedule m movie [ t(theater) = s(theater) s(title) = m(title) m(director) = Berto ] } relational algebra: π theater (schedule σ dir = Berto (movie)) Note: number of items in FROM clause = (number of joins + 1) 52

Computational Logic. Relational Query Languages with Negation. Free University of Bozen-Bolzano, Werner Nutt

Computational Logic. Relational Query Languages with Negation. Free University of Bozen-Bolzano, Werner Nutt Computational Logic Free University of Bozen-Bolzano, 2010 Werner Nutt (Slides adapted from Thomas Eiter and Leonid Libkin) Computational Logic 1 Queries with All Who are the directors whose movies are

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

Exercise Sheet 1: Relational Algebra David Carral, Markus Krötzsch Database Theory, 17 April, Summer Term 2018

Exercise Sheet 1: Relational Algebra David Carral, Markus Krötzsch Database Theory, 17 April, Summer Term 2018 Exercise Sheet 1: Relational Algebra David Carral, Markus Krötzsch Database Theory, 17 April, Summer Term 2018 Exercise 1.1. Consider a cinema database with tables of the following form (adapted from a

More information

Movies Title Director Actor

Movies Title Director Actor Movies Title Director Actor The Trouble with Harry Hitchcock Gwenn The Trouble with Harry Hitchcock Forsythe The Trouble with Harry Hitchcock MacLaine The Trouble with Harry Hitchcock Hitchcock Cries and

More information

Relational Algebra on Bags. Why Bags? Operations on Bags. Example: Bag Selection. σ A+B < 5 (R) = A B

Relational Algebra on Bags. Why Bags? Operations on Bags. Example: Bag Selection. σ A+B < 5 (R) = A B Relational Algebra on Bags Why Bags? 13 14 A bag (or multiset ) is like a set, but an element may appear more than once. Example: {1,2,1,3} is a bag. Example: {1,2,3} is also a bag that happens to be a

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

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

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

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

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

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 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

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

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

Relational Database: Identities of Relational Algebra; Example of Query Optimization

Relational Database: Identities of Relational Algebra; Example of Query Optimization Relational Database: Identities of Relational Algebra; Example of Query Optimization Greg Plaxton Theory in Programming Practice, Fall 2005 Department of Computer Science University of Texas at Austin

More information

A Dichotomy. in in Probabilistic Databases. Joint work with Robert Fink. for Non-Repeating Queries with Negation Queries with Negation

A Dichotomy. in in Probabilistic Databases. Joint work with Robert Fink. for Non-Repeating Queries with Negation Queries with Negation Dichotomy for Non-Repeating Queries with Negation Queries with Negation in in Probabilistic Databases Robert Dan Olteanu Fink and Dan Olteanu Joint work with Robert Fink Uncertainty in Computation Simons

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

6 The Relational Data Model: Algebraic operations on tabular data

6 The Relational Data Model: Algebraic operations on tabular data 6 The Relational Data Model: Algebraic operations on tabular data 6.1 Basic idea of relational languages 6.2 Relational Algebra operations 6.3 Relational Algebra: Syntax and Semantics 6.4. More Operators

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

7 RC Simulates RA. Lemma: For every RA expression E(A 1... A k ) there exists a DRC formula F with F V (F ) = {A 1,..., A k } and

7 RC Simulates RA. Lemma: For every RA expression E(A 1... A k ) there exists a DRC formula F with F V (F ) = {A 1,..., A k } and 7 RC Simulates RA. We now show that DRC (and hence TRC) is at least as expressive as RA. That is, given an RA expression E that mentions at most C, there is an equivalent DRC expression E that mentions

More information

Comp 5311 Database Management Systems. 5. Functional Dependencies Exercises

Comp 5311 Database Management Systems. 5. Functional Dependencies Exercises Comp 5311 Database Management Systems 5. Functional Dependencies Exercises 1 Assume the following table contains the only set of tuples that may appear in a table R. Which of the following FDs hold in

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

Query answering using views

Query answering using views Query answering using views General setting: database relations R 1,...,R n. Several views V 1,...,V k are defined as results of queries over the R i s. We have a query Q over R 1,...,R n. Question: Can

More information

Relational Algebra SPJRUD

Relational Algebra SPJRUD Relational Algebra SPJRUD Jef Wijsen Université de Mons (UMONS) May 14, 2018 Jef Wijsen (Université de Mons (UMONS)) SPJRUD May 14, 2018 1 / 1 Tabular Representation The table A B C 1 3 2 1 4 1 2 4 2 2

More information

GAV-sound with conjunctive queries

GAV-sound with conjunctive queries GAV-sound with conjunctive queries Source and global schema as before: source R 1 (A, B),R 2 (B,C) Global schema: T 1 (A, C), T 2 (B,C) GAV mappings become sound: T 1 {x, y, z R 1 (x,y) R 2 (y,z)} T 2

More information

Homework Assignment 2. Due Date: October 17th, CS425 - Database Organization Results

Homework Assignment 2. Due Date: October 17th, CS425 - Database Organization Results Name CWID Homework Assignment 2 Due Date: October 17th, 2017 CS425 - Database Organization Results Please leave this empty! 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 2.10 2.11 2.12 2.15 2.16 2.17 2.18 2.19 Sum

More information

EECS-3421a: Test #2 Electrical Engineering & Computer Science York University

EECS-3421a: Test #2 Electrical Engineering & Computer Science York University 18 November 2015 EECS-3421a: Test #2 1 of 16 EECS-3421a: Test #2 Electrical Engineering & Computer Science York University Family Name: Given Name: Student#: CSE Account: Instructor: Parke Godfrey Exam

More information

Languages. Theory I: Database Foundations. Relational Algebra. Paradigms. Projection. Basic Operators. Jan-Georg Smaus (Georg Lausen)

Languages. Theory I: Database Foundations. Relational Algebra. Paradigms. Projection. Basic Operators. Jan-Georg Smaus (Georg Lausen) Languages Theory I: Database Foundations Jan-Georg Smaus (Georg Lausen) Paradigms 1. Languages: Relational Algebra Projection Union and Difference Summary 26.7.2011 Relational algebra Relational calculus

More information

CS632 Notes on Relational Query Languages I

CS632 Notes on Relational Query Languages I CS632 Notes on Relational Query Languages I A. Demers 6 Feb 2003 1 Introduction Here we define relations, and introduce our notational conventions, which are taken almost directly from [AD93]. We begin

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

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

ER Modelling: Summary

ER Modelling: Summary ER Modelling: Summary ER describes the world (the set of possible worlds) what it is and the laws of this world ER is static: it does not describe (legal) transitions Useful for two purposes build software

More information

Correlated subqueries. Query Optimization. Magic decorrelation. COUNT bug. Magic example (slide 2) Magic example (slide 1)

Correlated subqueries. Query Optimization. Magic decorrelation. COUNT bug. Magic example (slide 2) Magic example (slide 1) Correlated subqueries Query Optimization CPS Advanced Database Systems SELECT CID FROM Course Executing correlated subquery is expensive The subquery is evaluated once for every CPS course Decorrelate!

More information

Relational Calculus. Dr Paolo Guagliardo. University of Edinburgh. Fall 2016

Relational Calculus. Dr Paolo Guagliardo. University of Edinburgh. Fall 2016 Relational Calculus Dr Paolo Guagliardo University of Edinburgh Fall 2016 First-order logic term t := x (variable) c (constant) f(t 1,..., t n ) (function application) formula ϕ := P (t 1,..., t n ) t

More information

CS 347 Parallel and Distributed Data Processing

CS 347 Parallel and Distributed Data Processing CS 347 Parallel and Distributed Data Processing Spring 2016 Notes 3: Query Processing Query Processing Decomposition Localization Optimization CS 347 Notes 3 2 Decomposition Same as in centralized system

More information

Relational-Database Design

Relational-Database Design C H A P T E R 7 Relational-Database Design Exercises 7.2 Answer: A decomposition {R 1, R 2 } is a lossless-join decomposition if R 1 R 2 R 1 or R 1 R 2 R 2. Let R 1 =(A, B, C), R 2 =(A, D, E), and R 1

More information

Linear Algebra March 16, 2019

Linear Algebra March 16, 2019 Linear Algebra March 16, 2019 2 Contents 0.1 Notation................................ 4 1 Systems of linear equations, and matrices 5 1.1 Systems of linear equations..................... 5 1.2 Augmented

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

Culminating Review for Vectors

Culminating Review for Vectors Culminating Review for Vectors 0011 0010 1010 1101 0001 0100 1011 An Introduction to Vectors Applications of Vectors Equations of Lines and Planes 4 12 Relationships between Points, Lines and Planes An

More information

Lineage implementation in PostgreSQL

Lineage implementation in PostgreSQL Lineage implementation in PostgreSQL Andrin Betschart, 09-714-882 Martin Leimer, 09-728-569 3. Oktober 2013 Contents Contents 1. Introduction 3 2. Lineage computation in TPDBs 4 2.1. Lineage......................................

More information

MATH 8. Unit 1: Rational and Irrational Numbers (Term 1) Unit 2: Using Algebraic Properties to Simplify Expressions - Probability

MATH 8. Unit 1: Rational and Irrational Numbers (Term 1) Unit 2: Using Algebraic Properties to Simplify Expressions - Probability MATH 8 Unit 1: Rational and Irrational Numbers (Term 1) 1. I CAN write an algebraic expression for a given phrase. 2. I CAN define a variable and write an equation given a relationship. 3. I CAN use order

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

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

Design Theory: Functional Dependencies and Normal Forms, Part I Instructor: Shel Finkelstein

Design Theory: Functional Dependencies and Normal Forms, Part I Instructor: Shel Finkelstein Design Theory: Functional Dependencies and Normal Forms, Part I Instructor: Shel Finkelstein Reference: A First Course in Database Systems, 3 rd edition, Chapter 3 Important Notices CMPS 180 Final Exam

More information

Foundations of Databases

Foundations of Databases Foundations of Databases (Slides adapted from Thomas Eiter, Leonid Libkin and Werner Nutt) Foundations of Databases 1 Quer optimization: finding a good wa to evaluate a quer Queries are declarative, and

More information

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 Design and Implementation

Database Design and Implementation Database Design and Implementation CS 645 Data provenance Provenance provenance, n. The fact of coming from some particular source or quarter; origin, derivation [Oxford English Dictionary] Data provenance

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

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

Sect Addition, Subtraction, Multiplication, and Division Properties of Equality

Sect Addition, Subtraction, Multiplication, and Division Properties of Equality Sect.1 - Addition, Subtraction, Multiplication, and Division Properties of Equality Concept #1 Definition of a Linear Equation in One Variable An equation is a statement that two quantities are equal.

More information

Formal Semantics of SQL (and Cypher) Paolo Guagliardo

Formal Semantics of SQL (and Cypher) Paolo Guagliardo Formal Semantics of SQL (and Cypher) Paolo Guagliardo SQL Standard query language for relational databases $30B/year business Implemented in all major RDBMSs (free and commercial) First standardized in

More information

Schema Refinement & Normalization Theory: Functional Dependencies INFS-614 INFS614, GMU 1

Schema Refinement & Normalization Theory: Functional Dependencies INFS-614 INFS614, GMU 1 Schema Refinement & Normalization Theory: Functional Dependencies INFS-614 INFS614, GMU 1 Background We started with schema design ER model translation into a relational schema Then we studied relational

More information

MATH 7 HONORS. Unit 1: Rational and Irrational Numbers (Term 1) Unit 2: Using Algebraic Properties to Simplify Expressions - Probability

MATH 7 HONORS. Unit 1: Rational and Irrational Numbers (Term 1) Unit 2: Using Algebraic Properties to Simplify Expressions - Probability MATH 7 HONORS Unit 1: Rational and Irrational Numbers (Term 1) 1. I CAN write an algebraic expression for a given phrase. 2. I CAN define a variable and write an equation given a relationship. 3. I CAN

More information

Any Wizard of Oz fans? Discrete Math Basics. Outline. Sets. Set Operations. Sets. Dorothy: How does one get to the Emerald City?

Any Wizard of Oz fans? Discrete Math Basics. Outline. Sets. Set Operations. Sets. Dorothy: How does one get to the Emerald City? Any Wizard of Oz fans? Discrete Math Basics Dorothy: How does one get to the Emerald City? Glynda: It is always best to start at the beginning Outline Sets Relations Proofs Sets A set is a collection of

More information

1.5 F15 O Brien. 1.5: Linear Equations and Inequalities

1.5 F15 O Brien. 1.5: Linear Equations and Inequalities 1.5: Linear Equations and Inequalities I. Basic Terminology A. An equation is a statement that two expressions are equal. B. To solve an equation means to find all of the values of the variable that make

More information

Fundamentos lógicos de bases de datos (Logical foundations of databases)

Fundamentos lógicos de bases de datos (Logical foundations of databases) 20/7/2015 ECI 2015 Buenos Aires Fundamentos lógicos de bases de datos (Logical foundations of databases) Diego Figueira Gabriele Puppis CNRS LaBRI About the speakers Gabriele Puppis PhD from Udine (Italy)

More information

4 Conjunctive Queries

4 Conjunctive Queries 4 Conjunctive Queries Alice: Sergio: Riccardo: Vittorio: Shall we start asking queries? Very simple ones for the time being. But the system will answer them fast. And there is some nice theory. In this

More information

Logic and Databases. Phokion G. Kolaitis. UC Santa Cruz & IBM Research Almaden. Lecture 4 Part 1

Logic and Databases. Phokion G. Kolaitis. UC Santa Cruz & IBM Research Almaden. Lecture 4 Part 1 Logic and Databases Phokion G. Kolaitis UC Santa Cruz & IBM Research Almaden Lecture 4 Part 1 1 Thematic Roadmap Logic and Database Query Languages Relational Algebra and Relational Calculus Conjunctive

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

Advanced Data Management Technologies

Advanced Data Management Technologies ADMT 2018/19 Unit 12 J. Gamper 1/43 Advanced Data Management Technologies Unit 12 Generalized Multidimensional Join J. Gamper Free University of Bozen-Bolzano Faculty of Computer Science IDSE Acknowledgements:

More information

Lesson ACTIVITY: Tree Growth

Lesson ACTIVITY: Tree Growth Lesson 3.1 - ACTIVITY: Tree Growth Obj.: use arrow diagrams to represent expressions. evaluate expressions. write expressions to model realworld situations. Algebraic expression - A symbol or combination

More information

Information Systems for Engineers. Exercise 5. ETH Zurich, Fall Semester Hand-out Due

Information Systems for Engineers. Exercise 5. ETH Zurich, Fall Semester Hand-out Due Information Systems for Engineers Exercise 5 ETH Zurich, Fall Semester 2017 Hand-out 27.10.2017 Due 03.11.2017 Reading material: Chapter 2.4 in [1]. Lecture slides 4. 1. Given the two tables below, write

More information

7.13 7.14 7.15 J J WHERE CITY = 'London' ( SPJ WHERE J# = J# ( 'J1' ) ) { S# } 7.16 SPJ WHERE QTY QTY ( 300 ) AND QTY QTY ( 750 ) 7.17 7.18 7.19 7.20 7.21 P { COLOR, CITY } ( S JOIN P JOIN J ) { S#, P#,

More information

VCE. VCE Maths Methods 1 and 2 Pocket Study Guide

VCE. VCE Maths Methods 1 and 2 Pocket Study Guide VCE VCE Maths Methods 1 and 2 Pocket Study Guide Contents Introduction iv 1 Linear functions 1 2 Quadratic functions 10 3 Cubic functions 16 4 Advanced functions and relations 24 5 Probability and simulation

More information

P Q1 Q2 Q3 Q4 Q5 Tot (60) (20) (20) (20) (60) (20) (200) You are allotted a maximum of 4 hours to complete this exam.

P Q1 Q2 Q3 Q4 Q5 Tot (60) (20) (20) (20) (60) (20) (200) You are allotted a maximum of 4 hours to complete this exam. Exam INFO-H-417 Database System Architecture 13 January 2014 Name: ULB Student ID: P Q1 Q2 Q3 Q4 Q5 Tot (60 (20 (20 (20 (60 (20 (200 Exam modalities You are allotted a maximum of 4 hours to complete this

More information

RELATIONAL MODEL.

RELATIONAL MODEL. RELATIONAL MODEL Structure of Reltionl Dtbses Reltionl Algebr Tuple Reltionl Clculus Domin Reltionl Clculus Extended Reltionl-Algebr- Opertions Modifiction of the Dtbse Views EXAMPLE OF A RELATION BASIC

More information

Chapter 1-2 Add and Subtract Integers

Chapter 1-2 Add and Subtract Integers Chapter 1-2 Add and Subtract Integers Absolute Value of a number is its distance from zero on the number line. 5 = 5 and 5 = 5 Adding Numbers with the Same Sign: Add the absolute values and use the sign

More information

Relational Design Theory

Relational Design Theory Relational Design Theory CSE462 Database Concepts Demian Lessa/Jan Chomicki Department of Computer Science and Engineering State University of New York, Buffalo Fall 2013 Overview How does one design a

More information

Design Theory for Relational Databases. Spring 2011 Instructor: Hassan Khosravi

Design Theory for Relational Databases. Spring 2011 Instructor: Hassan Khosravi Design Theory for Relational Databases Spring 2011 Instructor: Hassan Khosravi Chapter 3: Design Theory for Relational Database 3.1 Functional Dependencies 3.2 Rules About Functional Dependencies 3.3 Design

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

CS 347 Distributed Databases and Transaction Processing Notes03: Query Processing

CS 347 Distributed Databases and Transaction Processing Notes03: Query Processing CS 347 Distributed Databases and Transaction Processing Notes03: Query Processing Hector Garcia-Molina Zoltan Gyongyi CS 347 Notes 03 1 Query Processing! Decomposition! Localization! Optimization CS 347

More information

As indicated in the previous chapter, the conjunctive queries, even if extended by union,

As indicated in the previous chapter, the conjunctive queries, even if extended by union, 5 Adding Alice: Vittorio: Sergio: Riccardo: Negation: Algebra and Calculus Conjunctive queries are great. But what if I want to see a movie that doesn t feature Woody Allen? We have to introduce negation.

More information

5 Systems of Equations

5 Systems of Equations Systems of Equations Concepts: Solutions to Systems of Equations-Graphically and Algebraically Solving Systems - Substitution Method Solving Systems - Elimination Method Using -Dimensional Graphs to Approximate

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

CS5300 Database Systems

CS5300 Database Systems CS5300 Database Systems Relational Algebra A.R. Hurson 323 CS Building hurson@mst.edu This module is intended to introduce: relational algebra as the backbone of relational model, and set of operations

More information

Sets. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry. Fall 2007

Sets. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry. Fall 2007 Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry Fall 2007 1 / 42 Computer Science & Engineering 235 Introduction to Discrete Mathematics Sections 2.1, 2.2 of Rosen Introduction I Introduction

More information

Lesson 12: Systems of Linear Equations

Lesson 12: Systems of Linear Equations Our final lesson involves the study of systems of linear equations. In this lesson, we examine the relationship between two distinct linear equations. Specifically, we are looking for the point where the

More information

Degree of a polynomial

Degree of a polynomial Variable Algebra Term Polynomial Monomial Binomial Trinomial Degree of a term Degree of a polynomial Linear A generalization of arithmetic. Letters called variables are used to denote numbers, which are

More information

First Steps in Relational Lattice

First Steps in Relational Lattice First Steps in Relational Lattice MARSHALL SPIGHT Marshall.Spight@gmai1.com VADIM TROPASHKO Vadim.Tropashko@orcl.com Relational lattice reduces the set of si classic relational algebra operators to two

More information

Relational algebra. Bence Molnár

Relational algebra. Bence Molnár Relational algebra Bence Molnár Introduction About relational algebra Basic properties of relational algebra: Well defined mathematical background Based on set theory Can be introduced through Armstrong

More information

CSE 344 AUGUST 6 TH LOSS AND VIEWS

CSE 344 AUGUST 6 TH LOSS AND VIEWS CSE 344 AUGUST 6 TH LOSS AND VIEWS ADMINISTRIVIA WQ6 due tonight HW7 due Wednesday DATABASE DESIGN PROCESS Conceptual Model: name product makes company price name address Relational Model: Tables + constraints

More information

Sets. We discuss an informal (naive) set theory as needed in Computer Science. It was introduced by G. Cantor in the second half of the nineteenth

Sets. We discuss an informal (naive) set theory as needed in Computer Science. It was introduced by G. Cantor in the second half of the nineteenth Sets We discuss an informal (naive) set theory as needed in Computer Science. It was introduced by G. Cantor in the second half of the nineteenth century. Most students have seen sets before. This is intended

More information

Sets. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry. Spring 2006

Sets. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry. Spring 2006 Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry Spring 2006 1 / 1 Computer Science & Engineering 235 Introduction to Discrete Mathematics Sections 1.6 1.7 of Rosen Introduction I We ve already

More information

Foundations of the PF relational calculus

Foundations of the PF relational calculus Foundations of the PF relational calculus J.N. Oliveira Dept. Informática, Universidade do Minho Braga, Portugal DI/UM, 2008 Recalling... Monotonicity: All operations are monotonic, eg. R S T U (R T) (S

More information

MIDTERM REVIEW. Write an algebraic expression to represent the following verbal expressions. 1) Double the difference of a number and 7.

MIDTERM REVIEW. Write an algebraic expression to represent the following verbal expressions. 1) Double the difference of a number and 7. NAME MIDTERM REVIEW DATE Write an algebraic epression to represent the following verbal epressions. 1) Double the difference of a number and 7. ) Find the value of the epression 0. Solve each equation.

More information

2.1 Sets. Definition 1 A set is an unordered collection of objects. Important sets: N, Z, Z +, Q, R.

2.1 Sets. Definition 1 A set is an unordered collection of objects. Important sets: N, Z, Z +, Q, R. 2. Basic Structures 2.1 Sets Definition 1 A set is an unordered collection of objects. Important sets: N, Z, Z +, Q, R. Definition 2 Objects in a set are called elements or members of the set. A set is

More information

Introduction. Normalization. Example. Redundancy. What problems are caused by redundancy? What are functional dependencies?

Introduction. Normalization. Example. Redundancy. What problems are caused by redundancy? What are functional dependencies? Normalization Introduction What problems are caused by redundancy? UVic C SC 370 Dr. Daniel M. German Department of Computer Science What are functional dependencies? What are normal forms? What are the

More information

Schema Refinement and Normal Forms

Schema Refinement and Normal Forms Schema Refinement and Normal Forms Chapter 19 Quiz #2 Next Thursday Comp 521 Files and Databases Fall 2012 1 The Evils of Redundancy v Redundancy is at the root of several problems associated with relational

More information

Mid-Semester Quiz Second Semester, 2012

Mid-Semester Quiz Second Semester, 2012 THE AUSTRALIAN NATIONAL UNIVERSITY Mid-Semester Quiz Second Semester, 2012 COMP2600 (Formal Methods for Software Engineering) Writing Period: 1 hour duration Study Period: 10 minutes duration Permitted

More information

Approximate String Joins in a Database (Almost) for Free

Approximate String Joins in a Database (Almost) for Free Approximate String Joins in a Database (Almost) for Free Erratum Luis Gravano Panagiotis G. Ipeirotis H. V. Jagadish Columbia University Columbia University University of Michigan gravano@cs.columbia.edu

More information

On the complexity of division and set joins in the relational algebra

On the complexity of division and set joins in the relational algebra On the complexity of division and set joins in the relational algebra Dirk Leinders a,, Jan Van den Bussche a a Hasselt University and transnational University of Limburg, Agoralaan, gebouw D, 3590 Diepenbeek,

More information

DATABASE DESIGN I - 1DL300

DATABASE DESIGN I - 1DL300 DATABASE DESIGN I - DL300 Fll 00 An introductory course on dtse systems http://www.it.uu.se/edu/course/homepge/dstekn/ht0/ Mnivskn Sesn Uppsl Dtse Lortory Deprtment of Informtion Technology, Uppsl University,

More information

1.1 Basic Algebra. 1.2 Equations and Inequalities. 1.3 Systems of Equations

1.1 Basic Algebra. 1.2 Equations and Inequalities. 1.3 Systems of Equations 1. Algebra 1.1 Basic Algebra 1.2 Equations and Inequalities 1.3 Systems of Equations 1.1 Basic Algebra 1.1.1 Algebraic Operations 1.1.2 Factoring and Expanding Polynomials 1.1.3 Introduction to Exponentials

More information

1991 Mathematics Subject Classification. 03B10, 68Q70.

1991 Mathematics Subject Classification. 03B10, 68Q70. Theoretical Informatics and Applications Informatique Théorique et Applications Will be set by the publisher DECIDING WHETHER A RELATION DEFINED IN PRESBURGER LOGIC CAN BE DEFINED IN WEAKER LOGICS Christian

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

Exam 1. March 12th, CS525 - Midterm Exam Solutions

Exam 1. March 12th, CS525 - Midterm Exam Solutions Name CWID Exam 1 March 12th, 2014 CS525 - Midterm Exam s Please leave this empty! 1 2 3 4 5 Sum Things that you are not allowed to use Personal notes Textbook Printed lecture notes Phone The exam is 90

More information

Provenance Semirings. Todd Green Grigoris Karvounarakis Val Tannen. presented by Clemens Ley

Provenance Semirings. Todd Green Grigoris Karvounarakis Val Tannen. presented by Clemens Ley Provenance Semirings Todd Green Grigoris Karvounarakis Val Tannen presented by Clemens Ley place of origin Provenance Semirings Todd Green Grigoris Karvounarakis Val Tannen presented by Clemens Ley place

More information

Polynomial expression

Polynomial expression 1 Polynomial expression Polynomial expression A expression S(x) in one variable x is an algebraic expression in x term as Where an,an-1,,a,a0 are constant and real numbers and an is not equal to zero Some

More information

Variables and Expressions

Variables and Expressions Variables and Expressions A variable is a letter that represents a value that can change. A constant is a value that does not change. A numerical expression contains only constants and operations. An algebraic

More information

You are here! Query Processor. Recovery. Discussed here: DBMS. Task 3 is often called algebraic (or re-write) query optimization, while

You are here! Query Processor. Recovery. Discussed here: DBMS. Task 3 is often called algebraic (or re-write) query optimization, while Module 10: Query Optimization Module Outline 10.1 Outline of Query Optimization 10.2 Motivating Example 10.3 Equivalences in the relational algebra 10.4 Heuristic optimization 10.5 Explosion of search

More information