




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Relational Databases, Relational Calculus and Logic, Syntax and Semantics, Procedural Vs Declarative, SQL, Relational Algebra, Relational Calculus, Logic, Validity, Systems of Formal Logic, Boolean Algebra, Aristotle, Translation Key, First Order Logic, Database as Interpretation, Dr Mohammad Yamin, Ms Zoe Brain, Lecture Slides, Relational Databases, Australian National University, Australia.
Typology: Slides
1 / 153
This page cannot be seen from the preview
Don't miss anything!





























































































Lecture 16: Relational Calculus and Logic
From relational algebra to relational calculus, and other logic-database connections.
relational calculus logic syntax and semantics of first order logic parallels between first order logic and relational databases
Read [E&N §6.6, §6.7, §8.5.4] for more on todays stuff.
Last week we saw relational algebra. Relational calculus is another formal database language, more like logic than algebra.
Last week we saw relational algebra. Relational calculus is another formal database language, more like logic than algebra.
That is, relational calculus expressions say what you want, rather than how to find out.
Actually, its not black and white. Consider the differences between the following 3 equivalent queries.
SELECT bdate, address FROM employee WHERE salary > 50000
SELECT bdate, address FROM employee WHERE salary > 50000
relational algebra
πbdate,address(σ(salary> 50000 )(employee))
relational calculus (see [E&N, §6.6.1])
{t.fname, t.address | employee(t) ∧ t.salary > 50000 }
{t.fname, t.address | employee(t) ∧ t.salary > 50000 }
it is based on “set-builder” notation
{t.fname, t.address | employee(t) ∧ t.salary > 50000 }
it is based on “set-builder” notation variable t stands for a tuple attribute names are functions, writing t.fname for fname(t)
{t.fname, t.address | employee(t) ∧ t.salary > 50000 }
it is based on “set-builder” notation variable t stands for a tuple attribute names are functions, writing t.fname for fname(t) relation names are predicates
{t.fname, t.address | employee(t) ∧ t.salary > 50000 }
it is based on “set-builder” notation variable t stands for a tuple attribute names are functions, writing t.fname for fname(t) relation names are predicates
To make proper sense of this, we need to understand a bit about formal logic.
What is Logic? History of logic and computation Main ideas of logic: statement (syntax) situation (semantics) truth argument validity proof Syntax and semantics of first order logic (but not deduction)
Logic is the study of good reasoning.
Is the reasoning in the following two examples good? Why, or why not?
The drums are louder than the bass. The guitar is louder than the drums. Therefore, the guitar is louder than the bass.
I told the bass player to turn it down or I’d punch his head in. Therefore, the guitar is louder than the bass.
Logic is the study of good reasoning.
Is the reasoning in the following two examples good? Why, or why not?
The drums are louder than the bass. The guitar is louder than the drums. Therefore, the guitar is louder than the bass.
I told the bass player to turn it down or I’d punch his head in. Therefore, the guitar is louder than the bass.
Logic seeks theories of good reasoning, to give answers and explanations to questions like these.
Logic came from philosophers trying to understand, explain and even improve the certainty of mathematical arguments. Philosophers use formal logic to analyse concepts into more basic ideas, and solve problems caused by the confusion of English.
Logic came from philosophers trying to understand, explain and even improve the certainty of mathematical arguments. Philosophers use formal logic to analyse concepts into more basic ideas, and solve problems caused by the confusion of English.
Nothing is better than a holiday in St Tropez. A ham sandwich is better than nothing. Thus, a ham sandwich is better than a holiday in St Tropez.