Uncertainty in Databases. Lecture 2: Essential Database Foundations

Size: px
Start display at page:

Download "Uncertainty in Databases. Lecture 2: Essential Database Foundations"

Transcription

1 Uncertainty in Databases Lecture 2: Essential Database Foundations

2 Table of Contents

3 Table of Contents Codd s Vision Codd Catches On Top Academic Recognition Selected Publication Venues

4 Codd s Vision Codd s Vision Codd Catches On Top Academic Recognition Selected Publication Venues 1970: Edgar F. Codd invents the Relational Database model Data stored as a collection fo relations that conform to a schema and can be accessed through a query language over the schema Separation between the logical and phisical layers Work done in IBM San Jose, which is now IBM Almaden E. F. Codd: A Relational Model of Data for Large Shared Data Banks. In Communications of the ACM 13(6): (1970) 1972: Codd introduced the relational algebra and the relational calculus (logical view of database querying), and proved their equal expressive power [Cod72]

5 Codd Catches On Codd s Vision Codd Catches On Top Academic Recognition Selected Publication Venues 1973: Michael Stonebraker and Eugene Wong implement Codd s vision in INGRES, which commercialised in 1983 and evolved to Postgres (now PostgreSQL) in : A group from the IBM San Jose lab implements Codd s vision in System R, which evolved to DB2 in 1983 SQL initially developed at IBM by Donald D. Chamberlin and Raymond F. Boyce [CB74] 1977: Influenced by Codd, Larry Ellison founds Software Development Laboratories, which becomes Relational Software in 1979, which becomes Oracle Systems Corporation in 1982, named after its flagship product Oracle database

6 Top Academic Recognition Codd s Vision Codd Catches On Top Academic Recognition Selected Publication Venues 1981: Codd receives the ACM Turing Award

7 Breaking News Codd s Vision Codd Catches On Top Academic Recognition Selected Publication Venues Last week: ACM announces Michael Stonebraker as the 2014 Turing Award winner for fundamental contributions to the concepts and practices underlying modern database systems

8 Selected Publication Venues Codd s Vision Codd Catches On Top Academic Recognition Selected Publication Venues Conferences: SIGMOD: ACM Special Interest Group on Management of Data (since 1975) PODS: ACM Symp. on Principles of Database Systems (since 1982) VLDB: Intl. Conf. on Very Large Databases (since 1975) ICDE: IEEE Intl. Conf. on Data Engineering (since 1984) ICDT: Intl. Conference on Database Theory (since 1986) EDBT: Intl. Conference on Extending Database Technology (since 1988) Journals: TODS: ACM Transactions on Database Systems (since 1976) VLDBJ: The VLDB Journal (since 1992) SIGMOD REC: ACM SIGMOD Record (since 1969)

9 Table of Contents Relations Database Schemas Logical Viewpoint

10 Relations Relations Database Schemas Logical Viewpoint A relation r consists of a heading (A 1,..., A m ), which is a sequence (A 1,..., A m ) of distinct attributes, and a body, which is a finite collection of tuples t = (a 1,..., a m ) of values We assume some infinite domain of values (or constants) By a convenient abuse of notation, a relation is often identified with its body (e.g., t r means that t is a tuple in the body of r) We may refer to the ith value in a tuple t R as t.a i or t[i]

11 Database Schemas Relations Database Schemas Logical Viewpoint A relation schema has a relation name (or relation symbol) R and a heading (A 1,..., A n ), which is again a sequence of attributes; it is denoted by R(A 1,..., A m ) Or simply R if the attributes are not important or clear from the context The arity of R(A 1,..., A m ) is m, and is denoted by ar(r) Sometimes the attributes are not important, and we may use just R/m to specify that R is a relation name of arity m A schema is a pair S = (R, Σ), where R is a set of relation schemas with distinct names, and Σ is a set of constraints over R R is often called a signature We later discuss languages of constraints

12 Database Instance Relations Database Schemas Logical Viewpoint A relation r is said to be over a relation schema R if r and R have the same heading A database instance (or just instance) I over a schema S = (R, Σ) associates with every relation name R a relation R I over R, such that all the constraints in Σ are satisfied We denote by Inst(S) the set of all the instances over S

13 Logical Viewpoint Relations Database Schemas Logical Viewpoint It is convenient and common to view the database as a logical system (first-order of higher-order logic) vocabulary=schema+built-in predicates (e.g., <, >, =), and structure=instance Database queries are viewed as logical formulas ϕ(x) over the database: Q(I) = {a I = ϕ(a)} But there are some significant restrictions of the logic: We usually have only relation (no function) symbols We usually consider only finite structures (cf. finite-model theory) should be independent of the domain outside the database (cf. relational calculus)

14 On Finite Structures Relations Database Schemas Logical Viewpoint Consider the set F = {ϕ i i = 1, 2,... } of sentences where ϕ i is the sentence R has at least i distinct tuples Each ϕ i is expressible in first-order logic Every finite subset of F has a finite model, but there is no finite model for F Hence, the compactness theorem no longer holds in the finite

15 Table of Contents Relational Algebra SQL Conjunctive

16 Relational Algebra SQL Conjunctive The queries we will consider are such that produce a relation from the database Formally, a query Q over a schema S is associated with a heading (A 1,..., A k ), and it maps every instance I Inst(S) into a relation with that heading

17 Example Relational Algebra SQL Conjunctive Takes student cno Ahuva 1 Alon 1 Ahuva 2 Course cno cname 1 AI 2 DB 3 PL Find all pairs (s, c) of students and courses, such that there exists a course number x where both Takes(s, x) and Course(x, c) hold student Ahuva Alon Ahuva cname AI AI DB

18 Boolean Relational Algebra SQL Conjunctive A special case is where k = 0, and then the result either contains the empty tuple or is empty; in this case we say that the query is Boolean Example: Is it the case that for some x, both Takes( Ahuva, x) and Course(x, DB ) hold? We often denote Q(I) = {()} by Q(I) = true or I = Q Q(I) = by Q(I) = false or I = Q Boolean queries are very important in the analysis query languages (expressiveness, complexity, optimization and equivalence, etc.)

19 Relational Algebra Relational Algebra SQL Conjunctive Introduced by Codd [Cod72] Used by existing database systems, mainly for internal query-plan optimization A collection of operations over relations Unary: r t; binary: (r, s) t via: 1 Applying the operators to the database relations 2 Composition

20 Algebraic Operators Relational Algebra SQL Conjunctive Union ( ), difference ( ) R S and R S allowed if R and S are union compatible, that is, the have the same heading Cartesian product ( ) R S allowed only when R and S have disjoint headings Projection (π) π A 1,...,A (R) allowed if A k 1,..., A k are distinct attributes of R Selection (σ) σ ϕ (R) allowed if ϕ is a condition over the attributes of R (e.g., A 1 = A 2 or A 1 A 2 ) Renaming (ρ) ρ A B (R) allowed if A is an attribute of R and B is not an attribute of R

21 Example Relational Algebra SQL Conjunctive Takes student cno Ahuva 1 Alon 1 Ahuva 2 Course cno cname 1 AI 2 DB 3 PL Takes ρ cno c Course student cno c cname Ahuva 1 1 AI Alon 1 1 AI Ahuva 2 2 DB Ahuva 1 2 DB Alon 1 3 PL Ahuva 2 3 PL

22 Example Relational Algebra SQL Conjunctive Takes student cno Ahuva 1 Alon 1 Ahuva 2 Course cno cname 1 AI 2 DB 3 PL σ cno=c (Takes ρ cno c Course) student cno c cname Ahuva 1 1 AI Alon 1 1 AI Ahuva 2 2 DB

23 Example Relational Algebra SQL Conjunctive Takes student cno Ahuva 1 Alon 1 Ahuva 2 Course cno cname 1 AI 2 DB 3 PL π student,cno,cname ( σcno=c (Takes ρ cno c Course) ) student cno cname Ahuva 1 AI Alon 1 AI Ahuva 2 DB In short: Takes Course (natural join)

24 Example Relational Algebra SQL Conjunctive Takes student cno Ahuva 1 Alon 1 Ahuva 2 Course cno cname 1 AI 2 DB 3 PL π student,cname ( σcno=c (Takes ρ cno c Course) ) student Ahuva Alon Ahuva cname AI AI DB

25 SQL Relational Algebra SQL Conjunctive SQL (Structured Query Language) is natural language to express relational algebra SELECT (projection)... AS (rename) FROM (Cartesian product) WHERE (selection) UNION MINUS And much more, e.g., aggregate operators (e.g., COUNT, SUM), clustering operators (e.g., GROUP BY, HAVING), ranking (e.g., ORDER BY, LIMIT), and more

26 The Example in SQL Relational Algebra SQL Conjunctive Takes student cno Ahuva 1 Alon 1 Ahuva 2 Course cno cname 1 AI 2 DB 3 PL Find all pairs (s, c) of students and courses, such that there exists a course number x where both Takes(s, x) and Course(x, c) hold SELECT S.student, C.cname FROM Takes T, Course C WHERE T.cno = C.cno

27 Conjunctive Relational Algebra SQL Conjunctive Conjunctive (CQs) are SELECT-FROM-WHERE queries (no MINUS, UNION, etc.) such that all the WHERE conditions are equalities among attributes CQs are typically represented in the following FOL notation: Q(x) : y [ ϕ 1 (x, y) ϕ k (x, y) ] where: x and y are disjoint sequences of variables Each ϕ i (x, y) is a an atomic formula of the form R(τ 1,..., τ m ) where R is an m-ary relation in the schema and each τ j is either a variable in x, a variable in y, or a constant value (e.g., 7 or Ahuva ) Every variable in x occurs at least once on the right hand side

28 CQ Terminology and Notation Relational Algebra SQL Conjunctive Q(x) : y [ ϕ 1 (x, y) ϕ k (x, y) ] For simplification, quantification and conjunction are omitted:

29 CQ Terminology and Notation Relational Algebra SQL Conjunctive Q(x) : y [ ϕ 1 (x, y) ϕ k (x, y) ] For simplification, quantification and conjunction are omitted: Q(x) : ϕ 1 (x, y),, ϕ k (x, y) A variables in x is called a free or head variable, and a variable in y is called an existential variable

30 CQ Terminology and Notation Relational Algebra SQL Conjunctive Q(x) : y [ ϕ 1 (x, y) ϕ k (x, y) ] For simplification, quantification and conjunction are omitted: Q(x) }{{} head : atom {}}{ ϕ 1 (x, y),, ϕ k (x, y) }{{} body A variables in x is called a free or head variable, and a variable in y is called an existential variable

31 The Example as CQ Relational Algebra SQL Conjunctive Takes student cno Ahuva 1 Alon 1 Ahuva 2 Course cno cname 1 AI 2 DB 3 PL Find all pairs (s, c) of students and courses, such that there exists a course number x where both Takes(s, x) and Course(x, c) hold Q(s, c) : Takes(s, x) Course(x, c)

32 Why Are CQs Interesting? Relational Algebra SQL Conjunctive This is the class of all the queries that can be phrased in RA when using only: Selection with equality predicate Projection Join For that reason, CQs are often called SPJ queries CQs are the building block of expressive query languages, such as Datalog Useful queries that are simple enough to perform deep investigation for various database problems As we shall see, there are significant deep insights and algorithms that apply only to conjunctive queries

33 Table of Contents Functional Dependencies Generalizing FDs Inclusion Dependencies Tuple-Generating Dependencies

34 Functional Dependencies Generalizing FDs Inclusion Dependencies Tuple-Generating Dependencies Why Do We Care about? Allow to enforce database coherence and avoid bugs Allow to formally determine what inconsistency means Very relevant to us May have dramatic effect on algorithms and complexity By focusing on specific classes of constraint languages, we allow for nontrivial analysis

35 Functional Dependencies Functional Dependencies Generalizing FDs Inclusion Dependencies Tuple-Generating Dependencies Lab name faculty SIPL LCL SSDL STAT EE CS CS IE LabRoom lab building room SIPL Meyer 100 SIPL Meyer 101 LCL Taub 100 SSDL Taub 200 A lab belongs to just one faculty (i.e., name is a key for Lab) A specific room in a specific building belongs to only one lab A lab may have multiple rooms, but all in the same building

36 Formal Definition Functional Dependencies Generalizing FDs Inclusion Dependencies Tuple-Generating Dependencies Let S be a schema A Functional Dependency (FD) over S is an expression of the form R : U V, where U and V are sets of attributes of R An instance I over S satisfies the FD R : U V if for every two tuples t 1 and t 2 of R I : t 1 and t 2 agree on U t 1 and t 2 agree on V By agree on W we mean that t 1 and t 2 have the same value in every position that corresponds to an attribute of W If U and V cover all the attributes of R, then R : U V is a key constraint and U is said to be a key for R As a simplified notation, we write U and V by simply listing their attributes (no set notation)

37 Example Revisited Functional Dependencies Generalizing FDs Inclusion Dependencies Tuple-Generating Dependencies Lab name faculty SIPL LCL SSDL STAT EE CS CS IE LabRoom lab building room SIPL Meyer 100 SIPL Meyer 101 LCL Taub 100 SSDL Taub 200

38 Example Revisited Functional Dependencies Generalizing FDs Inclusion Dependencies Tuple-Generating Dependencies Lab name faculty SIPL LCL SSDL STAT EE CS CS IE LabRoom lab building room SIPL Meyer 100 SIPL Meyer 101 LCL Taub 100 SSDL Taub 200 A lab belongs to just one faculty (i.e., lab is a key for Lab)

39 Example Revisited Functional Dependencies Generalizing FDs Inclusion Dependencies Tuple-Generating Dependencies Lab name faculty SIPL LCL SSDL STAT EE CS CS IE LabRoom lab building room SIPL Meyer 100 SIPL Meyer 101 LCL Taub 100 SSDL Taub 200 A lab belongs to just one faculty (i.e., lab is a key for Lab) Lab : name faculty

40 Example Revisited Functional Dependencies Generalizing FDs Inclusion Dependencies Tuple-Generating Dependencies Lab name faculty SIPL LCL SSDL STAT EE CS CS IE LabRoom lab building room SIPL Meyer 100 SIPL Meyer 101 LCL Taub 100 SSDL Taub 200 A specific room in a specific building belongs to only one lab

41 Example Revisited Functional Dependencies Generalizing FDs Inclusion Dependencies Tuple-Generating Dependencies Lab name faculty SIPL LCL SSDL STAT EE CS CS IE LabRoom lab building room SIPL Meyer 100 SIPL Meyer 101 LCL Taub 100 SSDL Taub 200 A specific room in a specific building belongs to only one lab LabRoom : building room lab

42 Example Revisited Functional Dependencies Generalizing FDs Inclusion Dependencies Tuple-Generating Dependencies Lab name faculty SIPL LCL SSDL STAT EE CS CS IE LabRoom lab building room SIPL Meyer 100 SIPL Meyer 101 LCL Taub 100 SSDL Taub 200 A lab may have multiple rooms, but all in the same building

43 Example Revisited Functional Dependencies Generalizing FDs Inclusion Dependencies Tuple-Generating Dependencies Lab name faculty SIPL LCL SSDL STAT EE CS CS IE LabRoom lab building room SIPL Meyer 100 SIPL Meyer 101 LCL Taub 100 SSDL Taub 200 A lab may have multiple rooms, but all in the same building LabRoom : lab building

44 Generalizing FDs Functional Dependencies Generalizing FDs Inclusion Dependencies Tuple-Generating Dependencies There are various formalisms that naturally extend FDs to cross-relation dependencies Following are two popular examples: Equality-Generating Dependencies (EGDs) Denial (DCs)

45 EGDs Functional Dependencies Generalizing FDs Inclusion Dependencies Tuple-Generating Dependencies The FD Lab : name faculty can be phrased in FOL as x, y, z [ Lab(x, y) Lab(x, z) y = z ] An EGD is an expression of the form x [ ϕ(x) y 1 = y 2 ] ϕ(x) is a conjunction of atomic formulas y 1 and y 2 are variables in x Example: Lab(l 1, f 1 ), Lab(l 2, f 2 ), LabRoom(l 1, b, r 1 ), LabRoom(l 2, b, r 2 ) f 1 = f 2

46 DCs Functional Dependencies Generalizing FDs Inclusion Dependencies Tuple-Generating Dependencies The FD Lab : name faculty can be phrased in FOL as x, y, z ( Lab(x, y) Lab(x, z) y z ) A DC is an expression of the form x ( ϕ(x) ψ(x) ) x = (x 1,..., x n ) is a sequence of variables Each ϕ(x) is a conjunction of atomic formulas Each γ(x) is a conjunction of comparisons between two variables in x (e.g., x 1 x 2, x 1 < x 2, x 1 x 2, etc.)

47 Inclusion Dependencies Functional Dependencies Generalizing FDs Inclusion Dependencies Tuple-Generating Dependencies Lab name faculty SIPL LCL SSDL STAT EE CS CS IE LabRoom lab building room SIPL Meyer 100 SIPL Meyer 101 LCL Taub 100 SSDL Taub 200 Every lab in LabRoom should be listed in the Lab relation (foreign key)

48 Formal Defintion Functional Dependencies Generalizing FDs Inclusion Dependencies Tuple-Generating Dependencies Let S be a schema An INclusion Dependency (IND) over S is an expression δ of the form R[A 1,..., A m ] S[B 1,..., B m ] where: R and S are relation name in S R and S may be equal A 1,..., A m are distinct attributes of R B 1,..., B m are distinct attributes of S An instance I over S satisfies δ if π A1,...,A m (R I ) π B1,...,B m (S I )

49 Example Functional Dependencies Generalizing FDs Inclusion Dependencies Tuple-Generating Dependencies Consider the relation Friend[person 1, person 2 ] Friend[person 1, person 2 ] Friend[person 2, person 1 ] means that friendship is symmetric

50 Another Example Functional Dependencies Generalizing FDs Inclusion Dependencies Tuple-Generating Dependencies Lab name faculty SIPL LCL SSDL STAT EE CS CS IE LabRoom lab building room SIPL Meyer 100 SIPL Meyer 101 LCL Taub 100 SSDL Taub 200 Every lab should be listed in the Lab relation (foreign key) LabRoom[lab] Lab[name]

51 Tuple-Generating Dependencies Functional Dependencies Generalizing FDs Inclusion Dependencies Tuple-Generating Dependencies The IND LabRoom[lab] Lab[name] can be phrased in FOL as x, y, z [ LabRoom(x, y, z) w[lab(x, w)] ] A Tuple-Generating Dependency (TGD) is an expression of the form x [ ϕ(x) yψ(x, y) ] where ϕ(x) and ψ(x, y) are conjunctions of atomic formulas Example: Researcher(p, l), LabRoom(l, b, r) r [PersonRoom(p, b, r )]

52 Question Functional Dependencies Generalizing FDs Inclusion Dependencies Tuple-Generating Dependencies Can we express that Friends is transitive with TGDs? Can we express that Friends has no triangles with TGDs?

53 Table of Contents Data and Combined Other Yardsticks of Efficiency

54 Types of Database Data and Combined Other Yardsticks of Efficiency We consider computational problems that involve one or more of the following components: Schema S A set Σ of constraints A query Q A database instance I Common complexity measures designed to distinguish one input from another (e.g., instances are far bigger than schemas/queries) Combined complexity: everyting is given as input Data complexity: I is given as input, everything else is fixed Formally, we consider infinitely many computational problems P S,Σ,Q, one per combination of S, Σ and Q

55 Data and Combined Other Yardsticks of Efficiency Example: of CQ Answering Problem Def. (Boolean CQ Evaluation) Given a schema S, a Boolean CQ Q over S and an instance I over S, determine whether Q(I) = true. We will show that this problem is NP-complete under combined complexity, by reduction from the Clique problem. Problem Def. (Clique) Given a graph G = (V, E) and a number k, determine whether G contains a clique of size k, that is, a subset U of V such that U = k and every two nodes in U are neighbours.

56 Reduction Data and Combined Other Yardsticks of Efficiency Given G = (V, E) with V = {1,..., n}, and k, construct: S = {R E /2} I G = {R E (i, j) {i, j} E and i < j} Q k is a CQ with existential variables X 1,..., X k, and an atom R E (X i, X j ) for every i and j with 1 i < j k For example, suppose that G is the following graph: I G = R E Q 3 : R E (X 1, X 2 ), R E (X 1, X 3 ), R(X 2, X 3 )

57 Correctness Data and Combined Other Yardsticks of Efficiency The reduction is correct since the following two are equivalent: 1 G has a clique of size at least k 2 Q k (I G ) = true Hence, determining whether Q(I) = true, given S, Q and I, is NP-hard Membership in NP is straightforward, hence, the problem is NP-complete Note: The schema S does not depend on the input (G, k), but the size of Q is quadratic in k

58 Data Data and Combined Other Yardsticks of Efficiency What is the data complexity of answering a query in RA? We consider the problem P S,Q of computing the answers for a query Q in RA (Relational Algebra) over a given input instance I over S The naive way of straightforwardly executing Q runs in polynomial time! As a special case, CQ evaluation is in polynomial time under data complexity Note that data complexity is insensitive to the representation of the query

59 Other Yardsticks of Efficiency Data and Combined Other Yardsticks of Efficiency Other yardsticks of efficiency are often used in database complexity; here are two examples:

60 Parameterized Data and Combined Other Yardsticks of Efficiency Parameterized complexity is between data complexity and combined complexity; Query evaluation is Fixed Parameter Tractable if it can be evaluated in time O(f(Q) p(i)), where f is any (computable) function of the query in p(i) is polynomial in the size of I Our reduction from clique shows that CQ evaluation is not likely to be FPT

61 Input-Output Data and Combined Other Yardsticks of Efficiency A query (e.g., CQ) may be required to output an exponential number of results Hence, it makes no sense to require evaluation in polynomial time Input-output complexity measures the time as a function of both the input and the output Polynomial total time: the running time is polynomial in the combined size of the input and the output Polynomial delay: the answers are produced one by one, where the delay between every two answers is polynomial in the input only

62 Table of Contents

63 I Donald D. Chamberlin and Raymond F. Boyce, SEQUEL: A structured english query language, SIGMOD, ACM, 1974, pp E. F. Codd, A relational model of data for large shared data banks, Commun. ACM 13 (1970), no. 6, , Relational completeness of data base sublanguages, Database Systems (1972),

64 End of lecture 2 Essential Database Foundations

Lecture 1: Conjunctive Queries

Lecture 1: Conjunctive Queries CS 784: Foundations of Data Management Spring 2017 Instructor: Paris Koutris Lecture 1: Conjunctive Queries A database schema R is a set of relations: we will typically use the symbols R, S, T,... to denote

More information

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

Relational Database: The Relational Data Model; Operations on Database Relations Relational Database: The Relational Data Model; Operations on Database Relations Greg Plaxton Theory in Programming Practice, Spring 2005 Department of Computer Science University of Texas at Austin Overview

More information

Logic and Databases. Phokion G. Kolaitis. UC Santa Cruz & IBM Research - Almaden

Logic and Databases. Phokion G. Kolaitis. UC Santa Cruz & IBM Research - Almaden Logic and Databases Phokion G. Kolaitis UC Santa Cruz & IBM Research - Almaden 1 Logic and Databases are inextricably intertwined. C.J. Date -- 2007 2 Logic and Databases Extensive interaction between

More information

Database Theory VU , SS Introduction: Relational Query Languages. Reinhard Pichler

Database Theory VU , SS Introduction: Relational Query Languages. Reinhard Pichler Database Theory Database Theory VU 181.140, SS 2018 1. Introduction: Relational Query Languages Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität Wien 6 March,

More information

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

Overview. CS389L: Automated Logical Reasoning. Lecture 6: First Order Logic Syntax and Semantics. Constants in First-Order Logic. Overview CS389L: Automated Logical Reasoning Lecture 6: First Order Logic Syntax and Semantics Işıl Dillig So far: Automated reasoning in propositional logic. Propositional logic is simple and easy to

More information

Schema Mappings and Data Exchange

Schema Mappings and Data Exchange Schema Mappings and Data Exchange Lecture #2 EASSLC 2012 Southwest University August 2012 1 The Relational Data Model (E.F. Codd 1970) The Relational Data Model uses the mathematical concept of a relation

More information

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

Web Science & Technologies University of Koblenz Landau, Germany. Relational Data Model Web Science & Technologies University of Koblenz Landau, Germany Relational Data Model Overview Relational data model; Tuples and relations; Schemas and instances; Named vs. unnamed perspective; Relational

More information

2.2.2.Relational Database concept

2.2.2.Relational Database concept Foreign key:- is a field (or collection of fields) in one table that uniquely identifies a row of another table. In simpler words, the foreign key is defined in a second table, but it refers to the primary

More information

Database Theory VU , SS Introduction: Relational Query Languages. Reinhard Pichler

Database Theory VU , SS Introduction: Relational Query Languages. Reinhard Pichler Database Theory Database Theory VU 181.140, SS 2011 1. Introduction: Relational Query Languages Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität Wien 8 March,

More information

Relational Model, Relational Algebra, and SQL

Relational Model, Relational Algebra, and SQL Relational Model, Relational Algebra, and SQL August 29, 2007 1 Relational Model Data model. constraints. Set of conceptual tools for describing of data, data semantics, data relationships, and data integrity

More information

Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Chapter 6 Outline. Unary Relational Operations: SELECT and

Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Chapter 6 Outline. Unary Relational Operations: SELECT and Chapter 6 The Relational Algebra and Relational Calculus Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 6 Outline Unary Relational Operations: SELECT and PROJECT Relational

More information

Relational Model: History

Relational Model: History Relational Model: History Objectives of Relational Model: 1. Promote high degree of data independence 2. Eliminate redundancy, consistency, etc. problems 3. Enable proliferation of non-procedural DML s

More information

Towards a Logical Reconstruction of Relational Database Theory

Towards a Logical Reconstruction of Relational Database Theory Towards a Logical Reconstruction of Relational Database Theory On Conceptual Modelling, Lecture Notes in Computer Science. 1984 Raymond Reiter Summary by C. Rey November 27, 2008-1 / 63 Foreword DB: 2

More information

CS 377 Database Systems

CS 377 Database Systems CS 377 Database Systems Relational Algebra and Calculus Li Xiong Department of Mathematics and Computer Science Emory University 1 ER Diagram of Company Database 2 3 4 5 Relational Algebra and Relational

More information

CMPS 277 Principles of Database Systems. https://courses.soe.ucsc.edu/courses/cmps277/fall11/01. Lecture #3

CMPS 277 Principles of Database Systems. https://courses.soe.ucsc.edu/courses/cmps277/fall11/01. Lecture #3 CMPS 277 Principles of Database Systems https://courses.soe.ucsc.edu/courses/cmps277/fall11/01 Lecture #3 1 Summary of Lectures #1 and #2 Codd s Relational Model based on the concept of a relation (table)

More information

3. Relational Data Model 3.5 The Tuple Relational Calculus

3. Relational Data Model 3.5 The Tuple Relational Calculus 3. Relational Data Model 3.5 The Tuple Relational Calculus forall quantification Syntax: t R(P(t)) semantics: for all tuples t in relation R, P(t) has to be fulfilled example query: Determine all students

More information

DATABASE THEORY. Lecture 18: Dependencies. TU Dresden, 3rd July Markus Krötzsch Knowledge-Based Systems

DATABASE THEORY. Lecture 18: Dependencies. TU Dresden, 3rd July Markus Krötzsch Knowledge-Based Systems DATABASE THEORY Lecture 18: Dependencies Markus Krötzsch Knowledge-Based Systems TU Dresden, 3rd July 2018 Review: Databases and their schemas Lines: Line Type 85 bus 3 tram F1 ferry...... Stops: SID Stop

More information

Informationslogistik Unit 4: The Relational Algebra

Informationslogistik Unit 4: The Relational Algebra Informationslogistik Unit 4: The Relational Algebra 26. III. 2012 Outline 1 SQL 2 Summary What happened so far? 3 The Relational Algebra Summary 4 The Relational Calculus Outline 1 SQL 2 Summary What happened

More information

A Generating Plans from Proofs

A Generating Plans from Proofs A Generating Plans from Proofs Michael Benedikt, University of Oxford and Balder ten Cate, LogicBlox and UC-Santa Cruz and Efthymia Tsamoura, University of Oxford Categories and Subject Descriptors: H.2.3

More information

Databases Lectures 1 and 2

Databases Lectures 1 and 2 Databases Lectures 1 and 2 Timothy G. Griffin Computer Laboratory University of Cambridge, UK Databases, Lent 2009 T. Griffin (cl.cam.ac.uk) Databases Lectures 1 and 2 DB 2009 1 / 36 Re-ordered Syllabus

More information

Uncertain Data Models

Uncertain Data Models Uncertain Data Models Christoph Koch EPFL Dan Olteanu University of Oxford SYNOMYMS data models for incomplete information, probabilistic data models, representation systems DEFINITION An uncertain data

More information

Introduction to Data Management CSE 344. Lectures 8: Relational Algebra

Introduction to Data Management CSE 344. Lectures 8: Relational Algebra Introduction to Data Management CSE 344 Lectures 8: Relational Algebra CSE 344 - Winter 2016 1 Announcements Homework 3 is posted Microsoft Azure Cloud services! Use the promotion code you received Due

More information

A Retrospective on Datalog 1.0

A Retrospective on Datalog 1.0 A Retrospective on Datalog 1.0 Phokion G. Kolaitis UC Santa Cruz and IBM Research - Almaden Datalog 2.0 Vienna, September 2012 2 / 79 A Brief History of Datalog In the beginning of time, there was E.F.

More information

Database Technology Introduction. Heiko Paulheim

Database Technology Introduction. Heiko Paulheim Database Technology Introduction Outline The Need for Databases Data Models Relational Databases Database Design Storage Manager Query Processing Transaction Manager Introduction to the Relational Model

More information

Relational Model 2: Relational Algebra

Relational Model 2: Relational Algebra Yufei Tao Department of Computer Science and Engineering Chinese University of Hong Kong The relational model defines: 1 the format by which data should be stored; 2 the operations for querying the data.

More information

Relational Databases

Relational Databases Relational Databases Jan Chomicki University at Buffalo Jan Chomicki () Relational databases 1 / 49 Plan of the course 1 Relational databases 2 Relational database design 3 Conceptual database design 4

More information

CMPS 277 Principles of Database Systems. Lecture #4

CMPS 277 Principles of Database Systems.  Lecture #4 CMPS 277 Principles of Database Systems http://www.soe.classes.edu/cmps277/winter10 Lecture #4 1 First-Order Logic Question: What is First-Order Logic? Answer: Informally, First-Order Logic = Propositional

More information

Chapter 2: Relational Model

Chapter 2: Relational Model Chapter 2: Relational Model Database System Concepts, 5 th Ed. See www.db-book.com for conditions on re-use Chapter 2: Relational Model Structure of Relational Databases Fundamental Relational-Algebra-Operations

More information

II. Structured Query Language (SQL)

II. Structured Query Language (SQL) II. Structured Query Language (SQL) Lecture Topics ffl Basic concepts and operations of the relational model. ffl The relational algebra. ffl The SQL query language. CS448/648 II - 1 Basic Relational Concepts

More information

INCONSISTENT DATABASES

INCONSISTENT DATABASES INCONSISTENT DATABASES Leopoldo Bertossi Carleton University, http://www.scs.carleton.ca/ bertossi SYNONYMS None DEFINITION An inconsistent database is a database instance that does not satisfy those integrity

More information

CSC Discrete Math I, Spring Sets

CSC Discrete Math I, Spring Sets CSC 125 - Discrete Math I, Spring 2017 Sets Sets A set is well-defined, unordered collection of objects The objects in a set are called the elements, or members, of the set A set is said to contain its

More information

Foundations of Databases

Foundations of Databases Foundations of Databases Relational Query Languages with Negation Free University of Bozen Bolzano, 2009 Werner Nutt (Slides adapted from Thomas Eiter and Leonid Libkin) Foundations of Databases 1 Queries

More information

Automata Theory for Reasoning about Actions

Automata Theory for Reasoning about Actions Automata Theory for Reasoning about Actions Eugenia Ternovskaia Department of Computer Science, University of Toronto Toronto, ON, Canada, M5S 3G4 eugenia@cs.toronto.edu Abstract In this paper, we show

More information

Relational Algebra. Procedural language Six basic operators

Relational Algebra. Procedural language Six basic operators Relational algebra Relational Algebra Procedural language Six basic operators select: σ project: union: set difference: Cartesian product: x rename: ρ The operators take one or two relations as inputs

More information

Chapter 6: Formal Relational Query Languages

Chapter 6: Formal Relational Query Languages Chapter 6: Formal Relational Query Languages Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Chapter 6: Formal Relational Query Languages Relational Algebra Tuple Relational

More information

Relational Model and Relational Algebra

Relational Model and Relational Algebra Relational Model and Relational Algebra CMPSCI 445 Database Systems Fall 2008 Some slide content courtesy of Zack Ives, Ramakrishnan & Gehrke, Dan Suciu, Ullman & Widom Next lectures: Querying relational

More information

Announcements. CSCI 334: Principles of Programming Languages. Exam Study Session: Monday, May pm TBL 202. Lecture 22: Domain Specific Languages

Announcements. CSCI 334: Principles of Programming Languages. Exam Study Session: Monday, May pm TBL 202. Lecture 22: Domain Specific Languages Announcements CSCI 334: Principles of Programming Languages Lecture 22: Domain Specific Languages Exam Study Session: Monday, May 14 2-4pm TBL 202 Instructor: Dan Barowy Exercise Domain Specific Languages

More information

Chapter 6 5/2/2008. Chapter Outline. Database State for COMPANY. The Relational Algebra and Calculus

Chapter 6 5/2/2008. Chapter Outline. Database State for COMPANY. The Relational Algebra and Calculus Chapter 6 The Relational Algebra and Calculus Chapter Outline Example Database Application (COMPANY) Relational Algebra Unary Relational Operations Relational Algebra Operations From Set Theory Binary

More information

Foundations of Databases

Foundations of Databases Foundations of Databases Free University of Bozen Bolzano, 2004 2005 Thomas Eiter Institut für Informationssysteme Arbeitsbereich Wissensbasierte Systeme (184/3) Technische Universität Wien http://www.kr.tuwien.ac.at/staff/eiter

More information

Inverting Schema Mappings: Bridging the Gap between Theory and Practice

Inverting Schema Mappings: Bridging the Gap between Theory and Practice Inverting Schema Mappings: Bridging the Gap between Theory and Practice Marcelo Arenas Jorge Pérez Juan Reutter Cristian Riveros PUC Chile PUC Chile PUC Chile R&M Tech marenas@ing.puc.cl jperez@ing.puc.cl

More information

Relational Algebra for sets Introduction to relational algebra for bags

Relational Algebra for sets Introduction to relational algebra for bags Relational Algebra for sets Introduction to relational algebra for bags Thursday, September 27, 2012 1 1 Terminology for Relational Databases Slide repeated from Lecture 1... Account Number Owner Balance

More information

Chapter 6 Part I The Relational Algebra and Calculus

Chapter 6 Part I The Relational Algebra and Calculus Chapter 6 Part I The Relational Algebra and Calculus Copyright 2004 Ramez Elmasri and Shamkant Navathe Database State for COMPANY All examples discussed below refer to the COMPANY database shown here.

More information

Relational Metadata Integration. Cathy Wyss

Relational Metadata Integration. Cathy Wyss Relational Metadata Integration Cathy Wyss April 22, 2005 1 Talk Overview 1. Motivating Scenario 2. Foundations (TODS, June 2005) Federated Data Model FIRA FISQL 3. Current Work Data mapping as search

More information

II. Structured Query Language (SQL)

II. Structured Query Language (SQL) II. Structured Query Language () Lecture Topics Basic concepts and operations of the relational model. The relational algebra. The query language. CS448/648 1 Basic Relational Concepts Relating to descriptions

More information

Chapter 6 The Relational Algebra and Calculus

Chapter 6 The Relational Algebra and Calculus Chapter 6 The Relational Algebra and Calculus 1 Chapter Outline Example Database Application (COMPANY) Relational Algebra Unary Relational Operations Relational Algebra Operations From Set Theory Binary

More information

The Relational Data Model

The Relational Data Model The Relational Data Model Peter Y. Wu Dept of Computer and Information Systems Robert Morris University Introduction: The Relational Model Proposed by Codd (1970) A relational model for large shared data

More information

Provable data privacy

Provable data privacy Provable data privacy Kilian Stoffel 1 and Thomas Studer 2 1 Université de Neuchâtel, Pierre-à-Mazel 7, CH-2000 Neuchâtel, Switzerland kilian.stoffel@unine.ch 2 Institut für Informatik und angewandte Mathematik,

More information

The Relational Model and Relational Algebra

The Relational Model and Relational Algebra The Relational Model and Relational Algebra Background Introduced by Ted Codd of IBM Research in 1970. Concept of mathematical relation as the underlying basis. The standard database model for most transactional

More information

Database Theory VU , SS Codd s Theorem. Reinhard Pichler

Database Theory VU , SS Codd s Theorem. Reinhard Pichler Database Theory Database Theory VU 181.140, SS 2011 3. Codd s Theorem Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität Wien 29 March, 2011 Pichler 29 March,

More information

1. The Relational Model

1. The Relational Model 1. The Relational Model Stéphane Bressan January 22, 2015 This lecture is based on material by Professor Ling Tok Wang. CS 4221: Database Design The Relational Model Ling Tok Wang National University of

More information

Structural Characterizations of Schema-Mapping Languages

Structural Characterizations of Schema-Mapping Languages Structural Characterizations of Schema-Mapping Languages Balder ten Cate University of Amsterdam and UC Santa Cruz balder.tencate@uva.nl Phokion G. Kolaitis UC Santa Cruz and IBM Almaden kolaitis@cs.ucsc.edu

More information

The Inverse of a Schema Mapping

The Inverse of a Schema Mapping The Inverse of a Schema Mapping Jorge Pérez Department of Computer Science, Universidad de Chile Blanco Encalada 2120, Santiago, Chile jperez@dcc.uchile.cl Abstract The inversion of schema mappings has

More information

Textbook: Chapter 6! CS425 Fall 2013 Boris Glavic! Chapter 3: Formal Relational Query. Relational Algebra! Select Operation Example! Select Operation!

Textbook: Chapter 6! CS425 Fall 2013 Boris Glavic! Chapter 3: Formal Relational Query. Relational Algebra! Select Operation Example! Select Operation! Chapter 3: Formal Relational Query Languages CS425 Fall 2013 Boris Glavic Chapter 3: Formal Relational Query Languages Relational Algebra Tuple Relational Calculus Domain Relational Calculus Textbook:

More information

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

Database System Concepts, 5 th Ed.! Silberschatz, Korth and Sudarshan See   for conditions on re-use Database System Concepts, 5 th Ed.! Silberschatz, Korth and Sudarshan See www.db-book.com for conditions on re-use " Structure of Relational Databases! Fundamental Relational-Algebra-Operations! Additional

More information

; Spring 2008 Prof. Sang-goo Lee (14:30pm: Mon & Wed: Room ) ADVANCED DATABASES

; Spring 2008 Prof. Sang-goo Lee (14:30pm: Mon & Wed: Room ) ADVANCED DATABASES 4541.564; Spring 2008 Prof. Sang-goo Lee (14:30pm: Mon & Wed: Room 302-208) ADVANCED DATABASES Syllabus Text Books Exams (tentative dates) Database System Concepts, 5th Edition, A. Silberschatz, H. F.

More information

arxiv: v1 [cs.db] 23 May 2016

arxiv: v1 [cs.db] 23 May 2016 Complexity of Consistent Query Answering in Databases under Cardinality-Based and Incremental Repair Semantics (extended version) arxiv:1605.07159v1 [cs.db] 23 May 2016 Andrei Lopatenko Free University

More information

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

COSC344 Database Theory and Applications. σ a= c (P) Lecture 3 The Relational Data. Model. π A, COSC344 Lecture 3 1 COSC344 Database Theory and Applications σ a= c (P) S P Lecture 3 The Relational Data π A, C (H) Model COSC344 Lecture 3 1 Overview Last Lecture Database design ER modelling This Lecture Relational model

More information

Database Systems SQL SL03

Database Systems SQL SL03 Inf4Oec10, SL03 1/52 M. Böhlen, ifi@uzh Informatik für Ökonomen II Fall 2010 Database Systems SQL SL03 Data Definition Language Table Expressions, Query Specifications, Query Expressions Subqueries, Duplicates,

More information

Lecture Query evaluation. Combining operators. Logical query optimization. By Marina Barsky Winter 2016, University of Toronto

Lecture Query evaluation. Combining operators. Logical query optimization. By Marina Barsky Winter 2016, University of Toronto Lecture 02.03. Query evaluation Combining operators. Logical query optimization By Marina Barsky Winter 2016, University of Toronto Quick recap: Relational Algebra Operators Core operators: Selection σ

More information

Chapter 3: Relational Model

Chapter 3: Relational Model Chapter 3: Relational Model Structure of Relational Databases Relational Algebra Tuple Relational Calculus Domain Relational Calculus Extended Relational-Algebra-Operations Modification of the Database

More information

Ontology and Database Systems: Foundations of Database Systems

Ontology and Database Systems: Foundations of Database Systems Ontology and Database Systems: Foundations of Database Systems Werner Nutt Faculty of Computer Science Master of Science in Computer Science A.Y. 2014/2015 Incomplete Information Schema Person(fname, surname,

More information

Semantic Optimization of Preference Queries

Semantic Optimization of Preference Queries Semantic Optimization of Preference Queries Jan Chomicki University at Buffalo http://www.cse.buffalo.edu/ chomicki 1 Querying with Preferences Find the best answers to a query, instead of all the answers.

More information

Database Systems SQL SL03

Database Systems SQL SL03 Checking... Informatik für Ökonomen II Fall 2010 Data Definition Language Database Systems SQL SL03 Table Expressions, Query Specifications, Query Expressions Subqueries, Duplicates, Null Values Modification

More information

Relative Information Completeness

Relative Information Completeness Relative Information Completeness Abstract Wenfei Fan University of Edinburgh & Bell Labs wenfei@inf.ed.ac.uk The paper investigates the question of whether a partially closed database has complete information

More information

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

DATABASE MANAGEMENT SYSTEM SHORT QUESTIONS. QUESTION 1: What is database? DATABASE MANAGEMENT SYSTEM SHORT QUESTIONS Complete book short Answer Question.. QUESTION 1: What is database? A database is a logically coherent collection of data with some inherent meaning, representing

More information

Database Systems. Basics of the Relational Data Model

Database Systems. Basics of the Relational Data Model Database Systems Relational Design Theory Jens Otten University of Oslo Jens Otten (UiO) Database Systems Relational Design Theory INF3100 Spring 18 1 / 30 Basics of the Relational Data Model title year

More information

Announcements. Relational Model & Algebra. Example. Relational data model. Example. Schema versus instance. Lecture notes

Announcements. Relational Model & Algebra. Example. Relational data model. Example. Schema versus instance. Lecture notes Announcements Relational Model & Algebra CPS 216 Advanced Database Systems Lecture notes Notes version (incomplete) available in the morning on the day of lecture Slides version (complete) available after

More information

Lecture 16. The Relational Model

Lecture 16. The Relational Model Lecture 16 The Relational Model Lecture 16 Today s Lecture 1. The Relational Model & Relational Algebra 2. Relational Algebra Pt. II [Optional: may skip] 2 Lecture 16 > Section 1 1. The Relational Model

More information

Incomplete Information: Null Values

Incomplete Information: Null Values Incomplete Information: Null Values Often ruled out: not null in SQL. Essential when one integrates/exchanges data. Perhaps the most poorly designed and the most often criticized part of SQL:... [this]

More information

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

Relational model continued. Understanding how to use the relational model. Summary of board example: with Copies as weak entity COS 597A: Principles of Database and Information Systems Relational model continued Understanding how to use the relational model 1 with as weak entity folded into folded into branches: (br_, librarian,

More information

The Complexity of Data Exchange

The Complexity of Data Exchange The Complexity of Data Exchange Phokion G. Kolaitis IBM Almaden kolaitis@almaden.ibm.com Jonathan Panttaja UC Santa Cruz jpanttaj@cs.ucsc.edu Wang-Chiew Tan UC Santa Cruz wctan@cs.ucsc.edu ABSTRACT Data

More information

Chapter 2: Intro to Relational Model

Chapter 2: Intro to Relational Model Non è possibile visualizzare l'immagine. Chapter 2: Intro to Relational Model Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Example of a Relation attributes (or columns)

More information

Informationslogistik Unit 5: Data Integrity & Functional Dependency

Informationslogistik Unit 5: Data Integrity & Functional Dependency Informationslogistik Unit 5: Data Integrity & Functional Dependency 27. III. 2012 Outline 1 Reminder: The Relational Algebra 2 The Relational Calculus 3 Data Integrity Keeping data consistent 4 Functional

More information

Introduction Relational Algebra Operations

Introduction Relational Algebra Operations CMPT 354 Introduction Relational Algebra Operations Projection and Selection Set Operations Joins Division Tuple Relational Calculus John Edgar 2 Query languages allow the manipulation and retrieval of

More information

Relational Model History. COSC 416 NoSQL Databases. Relational Model (Review) Relation Example. Relational Model Definitions. Relational Integrity

Relational Model History. COSC 416 NoSQL Databases. Relational Model (Review) Relation Example. Relational Model Definitions. Relational Integrity COSC 416 NoSQL Databases Relational Model (Review) Dr. Ramon Lawrence University of British Columbia Okanagan ramon.lawrence@ubc.ca Relational Model History The relational model was proposed by E. F. Codd

More information

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

Relational Algebra. Relational Algebra. 7/4/2017 Md. Golam Moazzam, Dept. of CSE, JU Relational Algebra 1 Structure of Relational Databases A relational database consists of a collection of tables, each of which is assigned a unique name. A row in a table represents a relationship among

More information

Introduction to Data Management CSE 344. Lectures 8: Relational Algebra

Introduction to Data Management CSE 344. Lectures 8: Relational Algebra Introduction to Data Management CSE 344 Lectures 8: Relational Algebra CSE 344 - Winter 2017 1 Announcements Homework 3 is posted Microsoft Azure Cloud services! Use the promotion code you received Due

More information

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

CS34800 Information Systems. The Relational Model Prof. Walid Aref 29 August, 2016 CS34800 Information Systems The Relational Model Prof. Walid Aref 29 August, 2016 1 Chapter: The Relational Model Structure of Relational Databases Relational Algebra Tuple Relational Calculus Domain Relational

More information

Foundations of Schema Mapping Management

Foundations of Schema Mapping Management Foundations of Schema Mapping Management Marcelo Arenas Jorge Pérez Juan Reutter Cristian Riveros PUC Chile PUC Chile University of Edinburgh Oxford University marenas@ing.puc.cl jperez@ing.puc.cl juan.reutter@ed.ac.uk

More information

CS317 File and Database Systems

CS317 File and Database Systems CS317 File and Database Systems Lecture 3 Relational Calculus and Algebra Part-2 September 10, 2017 Sam Siewert RDBMS Fundamental Theory http://dilbert.com/strips/comic/2008-05-07/ Relational Algebra and

More information

RELATIONAL DATA MODEL: Relational Algebra

RELATIONAL DATA MODEL: Relational Algebra RELATIONAL DATA MODEL: Relational Algebra Outline 1. Relational Algebra 2. Relational Algebra Example Queries 1. Relational Algebra A basic set of relational model operations constitute the relational

More information

1. Introduction; Selection, Projection. 2. Cartesian Product, Join. 5. Formal Definitions, A Bit of Theory

1. Introduction; Selection, Projection. 2. Cartesian Product, Join. 5. Formal Definitions, A Bit of Theory Relational Algebra 169 After completing this chapter, you should be able to enumerate and explain the operations of relational algebra (there is a core of 5 relational algebra operators), write relational

More information

Relational Algebra and Calculus

Relational Algebra and Calculus and Calculus Marek Rychly mrychly@strathmore.edu Strathmore University, @ilabafrica & Brno University of Technology, Faculty of Information Technology Advanced Databases and Enterprise Systems 7 September

More information

Modeling access. Relational query languages. Queries. Selection σ P (R) Relational model: Relational algebra

Modeling access. Relational query languages. Queries. Selection σ P (R) Relational model: Relational algebra COS 597A: Principles of Database and Information Systems Relational model: Relational algebra Modeling access Have looked at modeling information as data + structure Now: how model access to data in relational

More information

E-R diagrams and database schemas. Functional dependencies. Definition (tuple, attribute, value). A tuple has the form

E-R diagrams and database schemas. Functional dependencies. Definition (tuple, attribute, value). A tuple has the form E-R diagrams and database schemas Functional dependencies Definition (tuple, attribute, value). A tuple has the form {A 1 = v 1,..., A n = v n } where A 1,..., A n are attributes and v 1,..., v n are their

More information

Can We Trust SQL as a Data Analytics Tool?

Can We Trust SQL as a Data Analytics Tool? Can We Trust SQL as a Data nalytics Tool? SQL The query language for relational databases International Standard since 1987 Implemented in all systems (free and commercial) $30B/year business Most common

More information

Review Material: First Order Logic (FOL)

Review Material: First Order Logic (FOL) Information Integration on the WEB with RDF, OWL and SPARQL Review Material: First Order Logic (FOL) Grant Weddell October 7, 2013 Syntax of FOL Signatures Vocabularies are called signatures in FOL. The

More information

NP-Completeness. Algorithms

NP-Completeness. Algorithms NP-Completeness Algorithms The NP-Completeness Theory Objective: Identify a class of problems that are hard to solve. Exponential time is hard. Polynomial time is easy. Why: Do not try to find efficient

More information

CS317 File and Database Systems

CS317 File and Database Systems CS317 File and Database Systems Lecture 3 Relational Model & Languages Part-1 September 7, 2018 Sam Siewert More Embedded Systems Summer - Analog, Digital, Firmware, Software Reasons to Consider Catch

More information

ITCS 3160 DATA BASE DESIGN AND IMPLEMENTATION

ITCS 3160 DATA BASE DESIGN AND IMPLEMENTATION ITCS 3160 DATA BASE DESIGN AND IMPLEMENTATION JING YANG 2010 FALL Class 3: The Relational Data Model and Relational Database Constraints Outline 2 The Relational Data Model and Relational Database Constraints

More information

Auditing a Batch of SQL Queries

Auditing a Batch of SQL Queries Auditing a Batch of SQL Queries Rajeev Motwani, Shubha U. Nabar, Dilys Thomas Department of Computer Science, Stanford University Abstract. In this paper, we study the problem of auditing a batch of SQL

More information

( A(x) B(x) C(x)) (A(x) A(y)) (C(x) C(y))

( A(x) B(x) C(x)) (A(x) A(y)) (C(x) C(y)) 1 Introduction Finite model theory studies the expressive power of logics on finite models. Classical model theory, on the other hand, concentrates on infinite structures: its origins are in mathematics,

More information

Query Rewriting Using Views in the Presence of Inclusion Dependencies

Query Rewriting Using Views in the Presence of Inclusion Dependencies Query Rewriting Using Views in the Presence of Inclusion Dependencies Qingyuan Bai Jun Hong Michael F. McTear School of Computing and Mathematics, University of Ulster at Jordanstown, Newtownabbey, Co.

More information

Databases 1. Daniel POP

Databases 1. Daniel POP Databases 1 Daniel POP Week 4 Agenda The Relational Model 1. Origins and history 2. Key concepts 3. Relational integrity 4. Relational algebra 5. 12+1 Codd rules for a relational DBMSes 7. SQL implementation

More information

Appendix 1. Description Logic Terminology

Appendix 1. Description Logic Terminology Appendix 1 Description Logic Terminology Franz Baader Abstract The purpose of this appendix is to introduce (in a compact manner) the syntax and semantics of the most prominent DLs occurring in this handbook.

More information

Ontologies and Databases

Ontologies and Databases Ontologies and Databases Diego Calvanese KRDB Research Centre Free University of Bozen-Bolzano Reasoning Web Summer School 2009 September 3 4, 2009 Bressanone, Italy Overview of the Tutorial 1 Introduction

More information

Computing Query Answers with Consistent Support

Computing Query Answers with Consistent Support Computing Query Answers with Consistent Support Jui-Yi Kao Advised by: Stanford University Michael Genesereth Inconsistency in Databases If the data in a database violates the applicable ICs, we say the

More information

Appendix 1. Description Logic Terminology

Appendix 1. Description Logic Terminology Appendix 1 Description Logic Terminology Franz Baader Abstract The purpose of this appendix is to introduce (in a compact manner) the syntax and semantics of the most prominent DLs occurring in this handbook.

More information

CSE 20 DISCRETE MATH. Winter

CSE 20 DISCRETE MATH. Winter CSE 20 DISCRETE MATH Winter 2017 http://cseweb.ucsd.edu/classes/wi17/cse20-ab/ Final exam The final exam is Saturday March 18 8am-11am. Lecture A will take the exam in GH 242 Lecture B will take the exam

More information

UNIT 2 RELATIONAL MODEL

UNIT 2 RELATIONAL MODEL UNIT 2 RELATIONAL MODEL RELATIONAL MODEL CONCEPTS The relational Model of Data is based on the concept of a Relation. A Relation is a mathematical concept based on the ideas of sets. The strength of the

More information