Questions tagged [relational-algebra]

the study of relations (i.e., database tables) and relational operators (join, selection, projection, etc.) as a kind of algebraic structure.

87 questions
Filter by
Sorted by
Tagged with
9 views

E-R diagram exercise referencing to attribute of another entity

I have this E-R diagram Now im asked to add a entity named as "kiosk".At a kiosk up to 2 items of expedition of different category can be expedited.How do I add this in the E-R diagram? ...
81 views

Can quantifiers be used on variables bound on the left side of the pipe in Tuple Relational Calculus?

Our professor has solved an example for us. They taught us it's incorrect to use a quantifier (exists or forall) with a variable ...
39 views

Number of unique people who don't own trucks, but own cars

So, we have the tables: ...
75 views

Projection syntax - relational algebra

I'm trying to understand this paper and in Figure 1 page 389 there's a projection in the form of $\pi_{d.id : s.id}$. What does the colon mean? Because usually projections are simply $\pi_{name}(R)$
1 vote
902 views

Is it possible to convert any relational algebra expression into a relational calculus expression?

Let's for the sake of simplicity only focus on tuple relational calculus. Every relational algebra query can be broken down into the 5 atomic operations - projection, selection, set union, set ...
• 129
33 views

How to simplify the query qualification?

Given the following DB and query : Now if we need to simplify the query qualification, here is the answer from the book (Principle of distributed database systems, third edition) : My question is in ...
1 vote
98 views

constant relation in the base case of relational algebra

in the base case of the inductive definition of the operations of the relational algebra there is also the so called "constant relation" (as for example found in the definition here https://...
• 155
1 vote
38 views

Which of the query approaches are more efficient?

There are two relations, registered(participant,topic) and fee(participant,amount). The primary key for registered is (participant, topic) and the primary key for fee is participant. The premise is ...
29 views

Optional filters in relational database

I'm trying to create a procedure in MySQL/MariaDB with optional filters for each participating table. Assuming the tables are $A, B, C, \ldots$, each table may or may not be filtered, and the result ...
• 1,111
68 views

How attributes helps us to allow column interchange in a relational database?

A relation on two sets $A$ and $B$ is defined as the subset of the cartesian product $$A\times B = \{(a,b),\ a \in A, b \in B\}$$ A database is also a relation and each entry is an ordered tuple ...
• 33
1 vote
187 views

Check if a relation is reflexive, symmetric and transitive

I want to better understand how this actually works, as my solutions are sometimes not 100% correct. I have the following relation: Check if the following relation is reflexive, symmetric, and/or ...
• 113
1 vote
35 views

Is Neo4J computationally equivalent to relational algebra

I am wondering whether Neo4j and the associated Cypher query language is computationally equivalent to relational algebra? Any ideas or papers on that topic?
• 91
3k views

Using count() in Relational Algebra

Sell (Bar, Beer) I want a table in which the first column has the name of the beer and the second has the total number of bars which sell that beer, but I have no idea how to use count () in the right ...
• 1
1 vote
267 views

Are intersection and union redundant? Possibility to get smaller output without negation?

I've just started learning relational algebra, so I'm reading a lot of articles for this topic. Not so long ago I've encountered two statements that seem to be quite weird to me. ∩ and ∪ (...
• 13
1 vote
4k views

how to get rows with more than 1 appearance of a specific column in relational algebra

I have a table like this: ...
113 views

Relation Closure for F+

$A \rightarrow B C$ $C D \rightarrow E$ $B \rightarrow D$ $E \rightarrow A$ I have these Relations for R={A,B,C,D,E} Now I have to calculate the closure $F^+$ and give the candidate keys I came ...
• 51
1 vote
340 views

• 65
263 views

Domain relational calculus to relational algebra

I have an expression in DRC $\{\langle a,b,c \rangle \mid \langle a,b \rangle \in r \land \langle a,b \rangle \in s\}$, where $r = (A,B)$ and $s = (A,C)$. I want to convert it onto relational algebra ...
1 vote
254 views

Automatically merging relational data

Background Semiautomated file merging is a critical part of version control systems (all the ones I've used anyway!). This is usually accomplished on textual source code without the tool understanding ...
• 263
754 views

Relational algebra and indexes

How might indexes be represented in the context of relational algebra? How would an optimizer transform a query to use indexes?
• 203
1 vote
161 views

Is Datalog negation and the built-in predicate $\neq$ similar?

I was reading "Principles of Database & Knowledge-Base Systems, Vol. 1" by Jeffrey D. Ullman. There is a chapter about Datalog negation and as I was seeing the problems of negation I kept thinking ...
• 815
300 views

SQL, optimizing a select statement in relational algebra

is it possible to rewrite the following sql statement $\pi_{R.a,S.d} (\sigma_{R.b = "d" \land S.d \geq 100 \lor T.d \geq 200}((R\times S)\times T))$ ? My problem is, i dont know if it is possible to ...
133 views

What do the commas separating atomic events in a Relational Calculus formula means?

For instance, take the example of this book here on page 30. About the formula $$Q(x,x') = R(x), S(x,y), S(x',y), R(x')$$ described there, what do the commas mean? Is it the same as an "and" ...
What's the difference between the Cartesian product in set theory and in relational algebra? The Cartesian product in set theory is defined as: A \times B = \{(a, b) \mid (a \in A) \land (b \in B)\...