# Questions tagged [relational-algebra]

For questions about the algebra of relational model theory, involving operations like Projection (π) Selection (σ), Rename (ρ), and Natural join (⋈).

19 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
739 views

### Convert query in words to relational algebra

I have a follow-up question to a question I have previously asked on SO. Instead of the query from my initial question, I want to convert the following into relational algebra: List the names and ...
43 views

### Relational Algebra: how to express the combination of aggregation and projection?

Here I have a table, I would like to query the average salary of departments, the SQL statement should be select dept_name, avg(salary) from employee I try to express this SQL in relational algebra....
472 views

### How to write group by and having in a relational algebra interpreter?

I am practising writing relational algebra (RA) expressions in RA interpreter from Duke, but I can't figure out how to represent group by or having (from SQL). I have this expression, but I need to ...
53 views

### Converting from domain calculus to relational algebra

I have an assigned task at the uni and I have the three relations that follow: Customer (Name, City, Account) Offer (Product_Description, Supplier, Price) Order (Name, Product_Description, Quantity,...
27 views

### Do Selection attributes have to appear in Projection list in Relational Algebra

In extended relational algebra (aggregation being allowed) do you have to project all attributes that you use in a statement? So for example in the query below the attributes A.FO_ID and A.Arrival are ...
22 views

### Using relational algebra to check a condition for all

I encountered this question while revising for my finals exam on database theory. The following database contains information about car repair workshops. The following tables are used: Given two ...
81 views

### Equi Join On Union- and Intersection-Compatible Relations

Suppose that I have two union- and intersection-compatible relations; i.e., R1(A,B) and R2(C,D) as: Now , I want to find the join of both relations with equality conditions A=C and B=D. I have ...
19 views

### Finding Exclusive Pairings in Relational Algebra

classId | studentId 0 0 0 1 0 2 1 0 1 1 1 2 2 2 How do you find the pairs of students (s1, s2) that ONLY have classes with ...
14 views

### Relation Algebra: Selection of Cartesian Product

I am learning Relational Algebra basics for sql. I came across an example where the selection of cartesian product of two relations (R1 x R2) has been taken and I realize that it is same as selection(...
102 views

### Basic Relational Algebra Equivalence

The following relation schema: R(A,C), S(A,D), T(X,Y). Primary key attributes bold Would like to know why the following two are not equivalent queries Q1 = ĻA(ĻC<10(R)) and Q2 = ĻC<10(ĻA(R)) ...
129 views

### Relational Algebra Equivalence (basic)

I'm just getting started on an intro to databases course and have a question about writing relational algebra expressions. Schema: Person ( name, age, gender ) Frequents ( name, pizzeria ) Eats ( ...
141 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 ...
15 views

### Relation algebra problem with renaming columns

I am trying to rename a 2 columns after joining them together Ļ mmnrāMM.Kortnr, ebnrāEB.Kortnr Ļ Passagerare.Namn, Passagerare.Personnr, MM.Kortnr, EB.Kortnr Passagerare ā Passagerare.Personnr =EB....
14 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 ...
47 views

### Relational Algebra - Remove duplicate tuples without count

I was wondering if there is a way to remove the tuples from a table using relational algebra that have the same Value occurring in multiple columns or same column multiple times e.g. I want to ...
32 views

### Delete duplicate keys with relation algebra without count

Hi I am new to relational algebra. I was wondering if there is a way to remove the tuples from a table using relational algebra that have the same Value occurring in multiple columns or same column ...
100 views

### Proof Full Outer Join associative and Commutative

I'm trying to prove to myself that the order of full outer joins doesn't matter, but, in an abstract sense, I'm coming up with nothing. How would one go about proving that the order of a set of FULL ...