Skip to main content
Share Your Experience: Take the 2024 Developer Survey
5 votes

A tuple relational calculus equivalent for the given SQL query

A tuple relational calculus expression should be written with the usual language of first order logic. In this case, for instance, you could write: { [e.Name, d.Name] | Ǝ e ∈ Employee, Ǝ d ∈ ...
Renzo's user avatar
  • 4,080
2 votes

Converting SQL to Relational Algebra / Calculus

You have a number of "mistakes" in your SQL, that should be addressed before you translate it to relational algebra. You don't have a FROM in your SQL. You shouldn't start by JOINing. You seem to ...
joanolo's user avatar
  • 13.5k
2 votes
Accepted

Confusion with Tuple Relation Calculus Operations

∃s (student(s) ∧ s.sex = ‘F’ ∧ s.deptNo = d.deptId) For some s, s is a student & s is female & s is in d's department. ~∃s (student(s) ∧ s.sex = ‘F’ ∧ s.deptNo = d.deptId) For no s, s is a ...
philipxy's user avatar
  • 778
1 vote

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

If there is no index for A.id column, then database engine perform full table scan. So O(N) operations are performed. If there is a B+tree index for A.id then database optimizer may choose it, if ...
1 vote
Accepted

Declarative and Procedural Query Languages

The writing is poor. "Declarative" is informal & they use it it in two ways. The general meaning is, "describe a result (not a process)". But many descriptions of results have an obvious ...
philipxy's user avatar
  • 778
1 vote

Questions Concerning the Chase Test

CONFIRMED FROM MY PROF THAT THESE ANSWERS ARE RIGHT Let's start by creating a tableau for each relation, then joining them together, and running the chase test afterwards. **T₁(R₁(A,B,C,......,)) = ...
Niroosh Ka's user avatar
1 vote

How to express functional dependency in relational calculus and SQL?

Not knowing your full situation, I recommend something like this. The foreign keys should create the dependencies you need. If your SQL structure is already in a tabular format, you might consider ...
Sting's user avatar
  • 2,788
1 vote

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

In addition to Ziggy answer, if you want to make this diagram work, you need to edit it, for example you should create a third table called cleint_order and this table has primary key from Client ...
Ahmad Abuhasna's user avatar
1 vote
Accepted

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

UML class diagrams do not include relations in a class' attributes list, so when creating database tables representing those classes, the database designer must identify and specify them, much like ...
Ezequiel Tolnay's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible