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
0 answers
176 views

SQLite Calculating percentage with last week values

I have the following table transactions I need to calculate the percentage of growth for total transaction per day with past same day last week A simple way for my transactions table structure --------...
hesham shawky's user avatar
1 vote
1 answer
121 views

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 ...
Shir K's user avatar
  • 197
0 votes
2 answers
2k 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 ...
sam's user avatar
  • 3
1 vote
0 answers
99 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-...
Mandy's user avatar
  • 11
3 votes
1 answer
611 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 ...
Mohammed Ali Melhem's user avatar
2 votes
1 answer
241 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 ...
lu5er's user avatar
  • 123
3 votes
1 answer
909 views

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 ...
Niroosh Ka's user avatar
2 votes
0 answers
88 views

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 ...
Anes's user avatar
  • 63
3 votes
0 answers
872 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 ...
Kyoma's user avatar
  • 131
3 votes
0 answers
223 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&...
fer's user avatar
  • 91
1 vote
0 answers
441 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 ...
Kevin Del Castillo Ramirez's user avatar
2 votes
1 answer
10k 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 ( ...
Dino Abraham's user avatar
1 vote
1 answer
1k 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[...
Anish Sharma's user avatar
0 votes
1 answer
473 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: #...
Revolucion for Monica's user avatar
5 votes
2 answers
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 ...
Revolucion for Monica's user avatar
1 vote
0 answers
173 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 ...
Revolucion for Monica's user avatar
6 votes
2 answers
1k 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 ...
joshuadrs's user avatar
2 votes
1 answer
65 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 ...
Itay's user avatar
  • 123
6 votes
1 answer
10k 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 | ...
CodyBugstein's user avatar
1 vote
2 answers
2k views

What does <> mean in Relational Calculus?

I saw a Tuple Relational Calculus formula, and it contained the symbol <>. What does it mean?
CodyBugstein's user avatar