We’re rewarding the question askers & reputations are being recalculated! Read more.

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.

23 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
321 views

Algorithm for segmenting input query into query/join tree

Wondering what algorithms look like for implementing a complex JOIN query handler. Taking a look at this paper Building Query Compilers they talk about Query Graphs ...
2
votes
0answers
123 views

Two related partial order relations

We will consider a set whose elements I call "precedences". Precedences are related by two relations: "is subclass of" and "higher than", which are specified by some pairs (given on algorithm input) ...
2
votes
0answers
135 views

Relational Algebra obtaining a list of duplicates

I've tried researching, and my best strategy I've got is to attempt to pull out data from the table, and then push the data against itself in order to remove all duplicates, ending up with a table of ...
2
votes
0answers
159 views

Using cross-products with relational algebra

I have some questions about something that I'm working on in an assignment for my database class. Here is the schema for the questions I'm working on, so that you know what to refer to: ...
1
vote
0answers
209 views

Relational algebra for multiple legs of a flight

I'm trying to write the relational algebra for a problem related to this schema: I want to do the following: For each flight list the departure airport code for the first leg of the flight and the ...
1
vote
0answers
157 views

How to find the least optimised database query?

A library uses a relational database to store data about library books, their members and lending (books, which are currently borrowed). The database relations of this system are given below. Lengths ...
1
vote
0answers
99 views

Is existential quantifier redundant

I was reading Tuple Relational Calculus from a textbook. I came across this query: For every project located in 'Stafford', list the project number, the controlling department number, and the ...
1
vote
0answers
25 views

In search for toy relations to test relational algebra

Does anybody know any toy database / relations that are particularly good and also complete to demonstrate and test relational algebra concepts? I'm hoping some database researchers should have ...
0
votes
0answers
12 views

What is the difference between Instance of a relation and Instance of a relation schema?

Following question was asked in the exam. The correct answer to this question is 2. But, I feel that it is a wrong answer. Option 2 is an example of instance of a relation and not an example of ...
0
votes
0answers
30 views

For which instance are those relational queries equivalent?

I have the following problem and i hope you could help me. Given is the following database schema, Student($\underline{\text{MatNo}}$, SName) Course($\underline{\text{CNo}}$, CName) Took($\...
0
votes
0answers
39 views

Can I combine these two relations from the relational model?

I have the following task: Translate the following ER diagram to the relational model. Use as few relations as possible. Do not increase or decrease the capacity. How many relations does the ...
0
votes
0answers
55 views

Relational Algebra with only one operator?

There's a parlour game of inventing exotic operators for Relational Algebra, and thereby reducing the number of operators needed to be 'Relationally Complete'. A popular operator for this is 'Inner ...
0
votes
1answer
60 views

Finding the frequency of each unique value of an attribute in a relation (RELATIONAL ALGEBRA)

I am trying to figure out how I can use aggregate functions to solve this problem. For example if I had the table enrolled(student-id, course-id) 123 897 123 645 589 452 009 897 If I wanted to ...
0
votes
1answer
32 views

Whether same output is obtained for the two queries

Consider the following SQL Queries executed on the relation Employee: Employee (Eid, Ename, sal) Eid is the primary key Queries: S1:SELECT count (*) FROM Employee; S2: SELECT count (Eid)...
0
votes
0answers
53 views

Query Optimisation (Relational Algebra)

A generic SQL statement like the following can be translated directly to a relational algebra expression: SELECT A1, A2, …, An FROM T1, T2, …, Tm WHERE C ...
0
votes
0answers
33 views

finding third functional dependency and its candidate keys

i'm solving a multi part question regarding candidate keys and functional dependencies. now i've already found 2 dependencies(the canonical covering of the functional dependencies contains only 3 ...
0
votes
0answers
140 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 ...
0
votes
0answers
23 views

How many passes does it take to join 2 relations of fixed size with M buffer blocks?

So let's say 2 relations, B(R) = 200,000 and B(S) = 300,000. The memory buffer is M = 400 blocks. How many passes would this take to join? Notation:
0
votes
0answers
37 views

Proof of RAP-derivation sequence for a set of functional dependencies in relational databases

I'm reading David Maier's outstanding but out-of-print book on relational databases (the book,"The Theory of Relational Databases", is available online from the author's website http://web.cecs.pdx....
0
votes
0answers
320 views

Algorithm to test dependency preservation

Is there an algorithm to test whether the decomposition of relation $R$ into relations $R_1,\dots,R_n$ is dependency-preserving? In more detail, I am given a relation $R(x_1,\dots,x_m)$ on $m$ ...
0
votes
0answers
113 views

Relational Algebra - Mistake in the quiz?

I've just done a mini test and scored 9/10, however, from my understanding, I think this question is incorrect. Here is the only question which I don't understand how it can be correct: So I joined ...
0
votes
0answers
776 views

convert domain relational calculus with two same tuples to relational algebra

Given two relations $R(A, B)$ and $S(A, C)$. I can understand the early part is the projection of attribute $A$ from $S$, which could be written as $π_a(S)$, but later part is confusing and not ...
-2
votes
1answer
184 views

Query Super Type and Subtype in Mysql

Assuming I have a schema depicted in the image , showing relationships(specialization) between Staffs, Academic Staffs and Non Academic Staffs. Is it possible to have a query that retrieves the ...