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.

Filter by
Sorted by
Tagged with
0
votes
2answers
21 views

Delete duplicate keys with relation algebra

Hi I am new to databases and relational algebra. I was wondering if there is a way to remove the tuples from a table using relational algebra that have the same keys but different value. e.g. I want ...
0
votes
0answers
45 views

Find street number of the longest street in each city in Canada

Find street number of the longest street in each city in Canada Relevant relations: City(city-name,country-name,area,population) Street(stno,city-name,length) The keys are bolded My tuple ...
1
vote
0answers
57 views

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-...
2
votes
1answer
169 views

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 ...
2
votes
1answer
51 views

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 ...
3
votes
0answers
171 views

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: {<N&...
6
votes
1answer
7k views

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 | ...
2
votes
1answer
79 views

Questions Concerning the Chase Test

For the question above, my work for each of the questions is below the concerns. Here are my main concerns: Does the order in which you use the relations matter? Can you end up with less tuples with ...
2
votes
0answers
49 views

Converting from domain calculus to relational algebra

I have an assigned task at the uni and I have the three relations that follow: Customer (Name, City, Account) Offer (Product_Description, Supplier, Price) Order (Name, Product_Description, Quantity, ...
2
votes
1answer
39 views

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 ...
5
votes
2answers
2k views

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 ...
7
votes
2answers
455 views

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 ...
3
votes
1answer
3k views

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 ( ...
1
vote
0answers
137 views

How to express inclusive and exclusive relations in relational algebra and relational calculus?

Let be the following simplified database sketch: R1(P,S),R2(S,T) and R3(T,S) with P= people S = Sport and T= Sports Center How to find in relational algebra and relational calculus which couples ...
1
vote
1answer
855 views

A tuple relational calculus equivalent for the given SQL query

Well, here's a SQL query: select Employee.Name,Department.Name from Employee,Department where Employee.Dept_no=Department.No I have tried a tuple relational calculus on it as: {t|Ǝ s ∈ Employee (s[...
1
vote
2answers
973 views

What does <> mean in Relational Calculus?

I saw a Tuple Relational Calculus formula, and it contained the symbol <> I couldn't find any reference to it anywhere - can anyone tell me what this means? (perhaps this question will be a ...
0
votes
1answer
286 views

How to express functional dependency in relational calculus and SQL?

I want to express in relational calculus and SQL the following functional dependency associated with Vote. This is the first time I try to implement it in actual SQL and relational calculus. Vote: #...
3
votes
0answers
470 views

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 ...
1
vote
0answers
230 views

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