Questions tagged [relational-calculus]

For questions: (a) about one of the relational forms of predicate calculus, i.e., domain and tuple, or (b) about expressing queries on data contained in a relational database utilizing one of those forms of calculus.

20 questions
6
votes
1 answer

Find the highest graded student using Tuple Relational Calculus

Suppose I have a table of students, containing their ID and their grade: ----------------- | id | grade | ----------------- | 1 | 83 | | 2 | 94 | | 3 | 92 | | 4 | 78 | How do I write a Tuple Relational Calculus…
6
votes
2 answers

What are the practical uses for relational calculus?

In my Database Design course we are learning both Relational Algebra and Relational Calculus. I can see where Relational Algebra could be useful since it is closely tied to SQL. Our professor said that Relational Calculus was used as an alternative…
5
votes
2 answers

Creating relationships between tables that where not specified in the given UML diagram

Good evening! I'm working on designing my very first actual database from the following UML class diagram (in French unfortunately): I'm at the point of creating the relational sketch of it which I created this way: Yet, it creates some issues…
3
votes
1 answer

Declarative and Procedural Query Languages

In the book Database System Concepts 6th Edition, Chapter 2 (Relational Algebra), it states that there are three formal query languages, the relational algebra, the tuple relational calculus and the domain relational calculus, which are declarative…
3
votes
1 answer

Questions Concerning the Chase Test

[5 Marks] Let R(A,B,C,D,E) be decomposed into relations with the following three set of attributes {A,B,C}, {B,C,D}, and {A,C,E}. For each of the following sets of FD's, use the chase test to tell whether the decomposition of R is lossless. For…
3
votes
0 answers

Counting in Tuple Relational Calculus

Given the following schema: Staff (sid, sname) Project (pid, pdesc, pfrom, pto) Asset (aid, acat, adesc) Workfor (sid, pid, wfrom, wto) Assignment (aid, sid, pid, afrom, ato) Note: The bold attributes are the keys. Find the names of the staffs who…
3
votes
0 answers

Difference Between Implication and Conjunction in Domain Relational Calculus

I was reading my notes, and I came across this: Another example would be to find the names of the lecturers teaching all modules. We might reach for the following incorrect expression: { | ∃M ∀C ∀MN ∀Cr (lecturer(M, N) ∧ module(C, MN, Cr) ∧…
fer
  • 91
  • 1
  • 5
2
votes
1 answer

TRC: Select an ID if it appears on all measurements

I have these two "tables": Station (station_id, city) // Stations details Rainfall (station_id, date, amount) // Rainfall measurements With Tuple Relational Calculus (TRC), I need to get the IDs of all stations that have related…
2
votes
1 answer

Confusion with Tuple Relation Calculus Operations

I came upon a question like, Given the following relational schemas Student (studId, name, age, sex, deptNo, advisor) Department (deptId, DName, hod, phoneNo) Which of the following will be the tuple relational calculus query to obtain the…
2
votes
0 answers

Converting from domain calculus to relational algebra

At university I have been given these three relations: Customer (Name, City, Account) Offer (Product_Description Supplier, Price) Order (Name, Product_Description, Quantity, Supplier) and this domain calculus: {Name, City | ∃ Account,…
Anes
  • 63
  • 1
  • 3
2
votes
1 answer

Converting SQL to Relational Algebra / Calculus

I have designed a schema and generated a few SQL queries. I'm using PostgreSQL. For example: CREATE TABLE train ( train_code SERIAL PRIMARY KEY, name TEXT NOT NULL ); CREATE TABLE journey ( journey_id SERIAL PRIMARY KEY, int INTEGER, …
1
vote
2 answers

What does <> mean in Relational Calculus?

I saw a Tuple Relational Calculus formula, and it contained the symbol <>. What does it mean?
CodyBugstein
  • 253
  • 1
  • 3
  • 10
1
vote
1 answer

How can I calculate the cost of the query, if there is a `between` condition?

How can I calculate the cost of the query, if there is a between condition? Select * From A Where A.id between 10 and 50 If Index not exists and there is only one condition: Search in B+ tree to find the first block that meets the condition…
1
vote
0 answers

Find names of persons who own at least one house in each city in Canada using tuple relational calculus

I am working on the following exercise: Using tuple relational calculus, find names of persons who own at least one house in each city in Canada. The relevant relation schemas are: City (city-name, country-name, area, population) House…
Mandy
  • 11
  • 1
1
vote
0 answers

Quantifiers in Tuple Relational Calculus (Existencial and Universal)

Suppose this state for the relation schema Company I'm stuck trying to understand how, why and when I should use Quantifiers (Existencial and Universal) Examples: Here I understand how the existencial is working, all the formula bounded …
1
2