Questions tagged [tuple-relational-calculus]

Should be used for questions regarding Tuple relational calculus (TRC). Not to be confused with domain relational calculus (DRC) or relational algebra (RA).

Tuple relational calculus (TRC) is a calculus that was created and introduced by Edgar F. Codd as part of the relational model, in order to provide a declarative database-query language for data manipulation in this data model.

32 questions
0
votes
1 answer

Duplicate tuples in tuple relational calculus

Suppose we have a relation Student(Name,Marks) with 2 tuples (a,100) and (a,100). Now if I have a expression like :- { t.Name, t.Marks | Student(t) and t.Marks=100) . Then will I get both tuples or only a single tuple? I know that in relation…
Zephyr
  • 1,521
  • 3
  • 22
  • 42
0
votes
1 answer

Unsafe tuple calculus expressions

Consider a relation R1 (roll no,marks). Suppose the entries in R1 are (1,20) and (2,25) and let the domain of roll no and marks be all positive integers . Now a tuple calculus expression like { t | ~ (t belongs to R1) } is unsafe as we can have…
Zephyr
  • 1,521
  • 3
  • 22
  • 42
0
votes
2 answers

From SQL to tuple relational calculus with Join

I have two SQL-queries I need to convert into tuple relational calculus. The first query SELECT immobilie.* FROM immobilie WHERE 'Preis'<'100000' seems to be pretty obvious (if I understood it right): {w|w ϵ MAKLER ∧ w.Preis < `100000‘} But the…
Kendel Ventonda
  • 411
  • 3
  • 9
  • 22
0
votes
1 answer

How do you define a (1,6) cardinality using Relational calculus

I have these three tables: Customer Rent Book The cardinality between the Customer and the Rent table is (1,6) and the cardinality between the Rent and the Book table is (1,infinity). Using relational calculus's syntax, I would define a (0,1)…
Andrew
  • 1,035
  • 7
  • 22
  • 40
0
votes
1 answer

Convert sql to tuple relational calculus

I'm trying to convert an sql query into tuple relational calculus, but there is a NOT EXIST that causes me to be stuck. SQL query: SELECT num FROM a a1, b b1 WHERE a1.num = b1.no AND a1.name = "Tim" AND NOT EXIST (SELECT * FROM a a2, b b2 …
maregor
  • 777
  • 9
  • 32
0
votes
1 answer

Please clear this confusion regarding relational algebra/tuple relational calculus

1: The explanation given for this query is "the set of all tuples t such that there exists a tuple s in the relation borrow for which the values of t and s for the cname attribute are equal, and the value of s for the amount attribute is greater…
0
votes
1 answer

Relational calculus databases

I have a schema that looks like this: Student (sid, name, age, department) Course(cid, name) Enrollment(sid, cid, term, grade) Using relational calculus, find the names of the students who took all courses. What I have now looks like this: {t | ∃ s…
0
votes
1 answer

Self-join for Tuple Relational Calculus

Find the names, company names, and the manager names of all employees who work for a company located in the city of Vancouver. How to write this in Tuple Relational Calculus? I have been thinking this for a long time. Whenever it goes to "manages",…
Fan
  • 217
  • 3
  • 14
0
votes
1 answer

How to show that something increases relational expressive power?

How do I show that something increases relational expressive power? For example I have been given a problem in which I need to show whether adding some certain functionality to the select-project-join queries of SQL increases the expressive power.…
0
votes
1 answer

How would I find the highest/largest of something with relation algebra, domain relational calculus and tuple relational calculus

This is part of a homework assignment. I've got several questions asking find the eid of the employee with the highest salary, or 2nd highest salary. Find the pilot that is certified for the most aircrafts. I don't have any idea on how to do it.…
Justen
  • 4,859
  • 9
  • 44
  • 68
0
votes
1 answer

Relational Calculus Left Outer Join

I'm just hoping for guidelines, NOT answers. How is a left outer join written in Relational Calculus? Here is the statement I wrote in algebraic notation: Doctor (⟕) Doctor.Doc_id = Duty.Doc_id Duty (a left outer join symbol) And here's the…
0
votes
3 answers

How to implement sql "where not in" in tuple relational calculus?

I want to convert a sql query which has where not in clause to tuple relational calculus.Existential and Universal quantifier implements only where exists and where not exists clause so I want to know how to implement where not in? My tables are…
user1613360
  • 1,280
  • 3
  • 16
  • 42
0
votes
2 answers

Tuple Relational Calculus: taking the results of one query and adding it to another

I am looking to see how I can combine the results of one query into another expressed in TRC format. Question Retrieve the names of employees who make at least $10,000 more than the employee who is paid the least in the Company. DB Setup EMPLOYEE:…
-1
votes
1 answer

How to express queries in Tuple Relational Calculus?

Problem: Consider a relation of scheme Building(Street, Number, No.Apartments, Color, Age). TRC: find the oldest building in Downing Street. The associated SQL statement would be: SELECT MAX(Age) AS ‘Oldest building’, Street FROM Building WHERE…
9628001
  • 509
  • 1
  • 4
  • 11
-1
votes
1 answer

Trying to understand "Only" and "All" constraints in Tuple Relational Calculus

Suppose we have three schemas: Instructor(id:integer, name:string, age:integer, salary:real) Works(eid:integer, did:integer, pct-time:integer) Dept(did:integer, budget:real, managerid:integer) Let me start this by showing two similar problems: a)…
noob
  • 1
  • 1