# Recent questions tagged relational-calculus 0 votes
1 answer
1
The relational algebra expression equivalent to the tuple calculus expression $\{t\mid t ​ \in ​ r \land (t[A]=10 \land t[B]=20)\}$ is $\sigma_{(A=10\:\lor\:B=20)}(r)$ $\sigma_{(A=10)}(r)\cup\sigma_{(B=20)}(r)$ $\sigma_{(A=10)}(r)\cap\sigma_{(B=20)}(r)$ $\sigma_{(A=10)}(r)-\sigma_{(B=20)}(r)$
1 vote
1 answer
2
If $R$ is a relation in Relational Data Model and $A_1,A_2,\dots A_n$ are the attributes of relation $R$, what is the cardinality of $R$ expressed in terms of domain of attributes? $\mid R\mid\leq\mid \text{ dom }(A_1) \times \text{ dom }(A_2)\dots \text{ dom }(A_n)\mid$ ...
4 votes
5 answers
3
Which of the following has same expressive power with regard to relational query language? Rational algebra and domain relational calculus Relational algebra and tuples relational calculus Relational algebra and domain relational calculus restricted to safe expression Relational algebra and tuples relational calculus restricted to safe expression a and b only c and d only a and c only b and d only
0 votes
1 answer
4
Suppliers(sid, sname, address) Parts(pid, pname, color) Catalog(sid, pid, cost) Find the pids of the most expensive parts supplied by suppliers named Yosemite Sham
0 votes
1 answer
5
Given relation catalog(sid, pid, cost) Find pairs of sids such that the supplier with the first sid charges more for some part than the supplier with the second sid what is the relational algebra expression for this?
2 votes
3 answers
6
Given two relations R1 and R2, where R1 contains N1 tuples, R2 contains N2 tuples, and N2>N1> 0, give the minimum and maximum possible sizes (in tuples) for the result relation produced by each of the following relational algebra expressions. In each case, state any assumptions about ... difference) $R1 X R2$ (cartesian product) $σa=5(R1)$ (selection) $\pi a(R1)$ (projection) $R1/R2$ (division)
0 votes
0 answers
7
Consider the following relations: $\text{STD_CHOICES } (\underline{\text{Student_ID}}, \underline{\text{Course_ID}}, \text{Semester})$ and $\text{COURSE_ASSIGN} (\underline{\text{Teacher_ID}}, \underline{\text{Course_ID}}, \underline{\text{Semester}})$. The former ... output the ID for all the students who have not been taught by the same teacher in more than one course across all semesters.
0 votes
0 answers
8
Let R = (A, B) and S = (A, C), and let r (R) and s(S) be relations. Write SQL Queries equivalent to the following domain relational- calculus expressions: a. {< a > | $\exists b (< a, b > \epsilon¸r \wedge b$ ... $\exists c (< a, c > \epsilon, s \wedge \exists b1, b2 (< a, b1 > \epsilon, r \wedge < c, b2 > \epsilon r \wedge b1 > b2$))}
0 votes
1 answer
9
Let R = (A, B) and S = (A, C), and let r (R) and s(S) be relations. Using the special constant null, write tuple-relational-calculus expressions equivalent to each of the following: a. r $ROJ$ s b. r $FOJ$ s c. r $LOJ$ s
0 votes
0 answers
10
Give a tuple-relational-calculus expression to find the maximum value in relation r (A).
1 vote
0 answers
11
Consider the employee database shown here. Give expressions in tuple relational calculus and domain relational calculus for each of the following queries: a. Find the names of all employees who work for First Bank Corporation . b. Find the names and cities of residence of ... street, city ) works (person name, company name, salary) company (company name, city) manages (person name, manager name)
1 vote
1 answer
12
Consider the relational database given below where the primary keys are underlined. Give an expression in tuple relational calculus for each of the following queries: a. Find all employees who work directly for Jones. b. Find all cities of residence of all employees who ... street, city ) works (person name, company name, salary) company (company name, city) manages (person name, manager name)
0 votes
0 answers
13
Let R = (A, B) and S = (A,C), and let r (R) and s(S) be relations.Write expressions in relational algebra for each of the following queries: a. {< a > | ∃ b (< a, b > ∈ r ∧ b = 7)} b. {< a, b, c > | < a, b > ∈ r ∧ < a, c > ∈ s} c. {< a > | ∃ c (< a, c > ∈ s ∧ ∃ b1, b2 (< a, b1 > ∈ r ∧ < c, b2 > ∈ r ∧ b1 > b2))}
0 votes
0 answers
14
Let R = (A, B, C), and let r1 and r2 both be relations on schema R. Give an expression in the domain relational calculus that is equivalent to each of the following: a. $\prod _A(r1)$ b. $\sigma _{B =17} (r1)$ c. r1 ∪ r2 d. r1 ∩ r2 e. r1 − r2 f. $\prod _{A,B}(r1) \Join \prod _{B,C}(r2)$
0 votes
1 answer
15
SQL Aggregation is possible by extended relational algebra operators? SQL grouping is possible in relational algebra. Relational algebra is equivalent to safe relational calculus expressions, then grouping and aggregation possible in tuple relational calculus and domain relational calculus? What about ordering? Please explain how will we consider these questions from GATE point of view.
0 votes
0 answers
16
Given i= 0, j = 1, k = – 1 x = 0.5, y = 0.0 What is the output of given ‘C’ expression ? x * 3 & & 3 || j | k explanation please….
0 votes
1 answer
17
relation parts(pid, pname, color) catalog(sid, pid, cost) find the sids of suppliers who supply every red part. can someone give the TRC and DRC expression for this?
0 votes
0 answers
18
Answer is all Doubt ---how (1,4) is present in O/p
0 votes
1 answer
19
give domain relation calculus expression works(person-name, company-name, salary) find the names of all employees who earn more than every employee of Small Bank Corporation
0 votes
0 answers
20
Online Site For practicing Relational Algebra https://dbis-uibk.github.io/relax/calc.htm
0 votes
0 answers
21
How we find the given calculus is safe or not
0 votes
1 answer
22
I think it should be option a) All query $1,3,4$ are equivalent but $2$ is not equivalent. Query $2$ should be $\prod \text{Room no,hotel no,type,price}(\sigma \text{type='single' } \wedge \text{price=200 })$
1 vote
2 answers
23
Relation Schema : Employee (Name, Ssn, Bdate, Address, Dept_number) Project (Pname, Pno, Dept_number) WorksOn (Essn, Pno, Hours) List the names of employees who work on all the projects controlled by department number 10. My Answer : ... and thus those employees name will be printed who work for some project at department no. 5 and not for the department no. 10 ?
0 votes
1 answer
24
I am not well versed in Predicate calculus and maybe, therefore, I am having problems writing queries in Tuple Relational Calculus and sometimes also in interpreting them. I want to know if there is any specific and definite procedure of translating the Relational ... some names of good books/lectures on predicate calculus. Any guidance or reference would be highly helpful for me. Thank You.
0 votes
1 answer
25
1 vote
2 answers
26
If there are three tables to choose from - Sailors(sid,sname); Reserves(sid,bid); Boats(bid,color) Question is to choose a sailor who reserved a red boat. My question is what is the difference between these two TRC expressions. ... Which of the above is correct? Are both correct? Are none correct?
8 votes
1 answer
27
The following relations are used to store data about students, courses, enrollment of students in courses and teachers of courses. Attributes for primary key in each relation are marked by $\text{*'}.$ $\text{students} (\text{rollno*},\text{sname},\text{saddr})$ ... prove that it is in $\text{3NF}$. If not, normalize the relations so that they are in $\text{3NF}$ (without proving).
2 votes
0 answers
28
I have two doubts: 1) A natural join B What will be the result when B don't have any tuple in it. Like in B their is relational algebra expression which is selecting Cars of green color but their is no green color car in table. What will be the result in this case. 2) A / B In above divison if B is a relational algebra expression returning nothing ( like the B in case 1). What will be the result ?