Recent questions tagged relational-algebra

31 31 votes
3 answers 3 answers
11.5k
11.5k views
Consider the following relational schema:COURSES (cno, cname)STUDENTS (rollno, sname, age, year)REGISTERED_FOR (cno, rollno)The underlined attributes indicate the primary...
38 38 votes
8 answers 8 answers
11.9k
11.9k views
Give a relational algebra expression using only the minimum number of operators from $(∪, −)$ which is equivalent to $R$ $∩$ $S.$
142 142 votes
15 answers 15 answers
37.0k
37.0k views
Information about a collection of students is given by the relation $\text{studInfo(}\underline{\text{studId}},\text{ name, sex)}$. The relation $\text{enroll(}{\text{stu...
66 66 votes
4 answers 4 answers
20.7k
20.7k views
Suppose $R_{1} (\underline{A}, B)$ and $R_{2} (\underline{C}, D) $ are two relation schemas. Let $r_{1}$ and $r_{2}$ be the corresponding relation instances. $B$ is a for...
97 97 votes
3 answers 3 answers
23.4k
23.4k views
Consider the relational schema given below, where eId of the relation dependent is a foreign key referring to empId of the relation employee. Assume that every employee h...
63 63 votes
6 answers 6 answers
17.9k
17.9k views
What is the optimized version of the relation algebra expression $\pi_{A1}(\pi_{A2}(\sigma_{F1}(\sigma_{F2}(r))))$, where $A1, A2$ are sets of attributes in $r$ with $A1...
41 41 votes
10 answers 10 answers
17.1k
17.1k views
Consider the following relational database schemes:COURSES (Cno, Name)PRE_REQ(Cno, Pre_Cno)COMPLETED (Student_no, Cno)COURSES gives the number and name of all the availab...
41 41 votes
2 answers 2 answers
13.6k
13.6k views
Given two union compatible relations $R_1(A, B)$ and $R_2 (C, D)$, what is the result of the operation $R_1 \Join_{ A = C \wedge B = D} R_2$?$R_1 \cup R_2$$R_1 \times R_2...
62 62 votes
5 answers 5 answers
26.9k
26.9k views
Consider the join of a relation $R$ with a relation $S$. If $R$ has $m$ tuples and $S$ has $n$ tuples then the maximum and minimum sizes of the join respectively are$m+n$...
79 79 votes
6 answers 6 answers
26.2k
26.2k views
Let r be a relation instance with schema R = (A, B, C, D). We define $r_1 = \pi_{A, B, C} (R)$ and $r_2=\pi_{A, D} (r)$. Let $s =r_1 \: * \: r_2$ where $*$ denotes natura...
94 94 votes
9 answers 9 answers
29.2k
29.2k views
Consider the relation Student (name, sex, marks), where the primary key is shown underlined, pertaining to students in a class that has at least one boy and one girl. Wha...
59 59 votes
6 answers 6 answers
15.9k
15.9k views
Consider the following SQL querySelect distinct $a_1, a_2, …, a_n$from $r_1, r_2, …, r_m$where PFor an arbitrary predicate P, this query is equivalent to which of the fol...
47 47 votes
7 7 answers
11.4k
11.4k views
A university placement center maintains a relational database of companies that interview students on campus and make job offers to those successful in the interview. The...
22 22 votes
2 answers 2 answers
7.8k
7.8k views
Consider a relation examinee (regno, name, score), where regno is the primary key to score is a real number.Write a relational algebra using $( \Pi, \sigma, \rho, \times)...
70 70 votes
3 answers 3 answers
13.6k
13.6k views
Let r and s be two relations over the relation schemes R and S respectively, and let A be an attribute in R. The relational algebra expression $\sigma_{A=a}(r \bowtie s)...
90 90 votes
5 answers 5 answers
15.4k
15.4k views
Suppose the adjacency relation of vertices in a graph is represented in a table Adj $(X,Y).$ Which of the following queries cannot be expressed by a relational algebra ex...
62 62 votes
4 answers 4 answers
22.9k
22.9k views
Given the relationsemployee (name, salary, dept-no), anddepartment (dept-no, dept-name,address),Which of the following queries cannot be expressed using the basic relatio...
105 105 votes
4 answers 4 answers
30.9k
30.9k views
Let R and S be two relations with the following schema$R(\underline{P,Q}, R1, R2, R3)$$S(\underline{P,Q}, S1, S2)$where $\left\{P, Q\right\}$ is the key for both schemas....