# 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
31 views

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

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

### How do relational algebra query analyzers generate query alternatives?

tl;dr: How does a query analyzer know how to modify a query to find a better one? I would like to implement a distributed database. I have figured out ways of storing data in a normalized form, and ...
• 1,871
44 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)$
20 views

### Are there some database models (or possibly data structures) which implement some aspects of relational algebra without using SQL?

Are there some database models (or possibly data structures) which implement some aspects of relational algebra without using SQL? More precisely, are there some RDMS which use the host language as a ...
• 153
1 vote
376 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 ...
• 121
24 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
40 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://...
• 113
1 vote
32 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 ...
25 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,055
52 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
90 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
29 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
1k 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
141 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
2k views

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

I have a table like this: ...
52 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 ...
• 53
1 vote
110 views

• 65
179 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
244 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 ...
• 161
657 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
151 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 ...
• 805
265 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 ...
110 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)\...