relational-algebra
GATE CSE & IT · Relational Model · 1994-2026
Study anchor
Korth — Database System Concepts
Relational model, SQL, normalization, transactions
Practice action
Start latest PYQPYQs in this concept
All concepts →Consider a relational database schema with two relations $R(P, Q)$ and $S(X, Y)$. Let $E=\{\langle u\rangle \mid \exists v \exists w\langle u, v\rangle \in R \wedge\langle v, w\ran...
Consider the following two relations, R(A,B) and S(A,C): The total number of tuples obtained by evaluating the following expression $\sigma_{B<C}(R \bowtie_{R.A=S.A} S)$ is _______...
The relation schema, Person (pid, city), describes the city of residence for every person uniquely identified by pid. The following relational algebra operators are available: sele...
Consider the following two relations, R(A, B) and S(A, C) : R A B 10 20 20 30 30 40 30 50 50 95 S A C 10 90 30 45 40 80 The total number of tuples obtained by evaluating the follow...
The relation schema, Person ($\underline{\text{pid}}$, $city$), describes the city of residence for every person uniquely identified by $pid$. The following relational algebra oper...
Consider the following three relations in a relational database. Employee ( $$\underline {eld} $$ , Name), Brand ( $$\underline {bld} $$ , bName), Own ( $$\underline {eld} $$ , $$\...
A relation r(A, B) in a relational database has 1200 tuples. The attribute A has integer values ranging from 6 to 20, and the attribute B has integer values ranging from 1 to 20. A...
Consider the relations $$r(A, B)$$ and $$s(B, C),$$ where $$s.B$$ is a primary key and $$r.B$$ is a foreign key referencing $$s.B.$$ Consider the query $$Q:$$ $$\,\,\,\,\,\,\,\,\,$...
Consider two relations $${R_1}\left( {A,B} \right)$$ with the tuples $$(1,5), (3,7)$$ and $${R_2}\left( {A,C} \right) = \left( {1,7} \right),\left( {4,9} \right).$$ Assume that $$R...
SELECT operation in SQL is equivalent to
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 \subset...
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 has at lea...
Consider the following relational schema. Students( rollno: integer, sname: string) Courses( courseno: integer, cname: string) Registration( rollno: integer, courseno: integer, per...
Suppose R 1 ( A, B) and R 2 ( C, D) are two relation schemas. Let r 1 and r 2 be the corresponding relation instances. B is a foreign key that refers to C in R 2 . If data in r 1 a...
Consider the following relations A, B and C: A ID Name Age 12 Arun 60 15 Shreya 24 99 Rohit 11 B ID Name Age 15 Shreya 24 25 Hari 40 98 Rohit 20 99 Rohit 11 C ID Phone Area 10 2200...
Consider the following relations A, B and C: A ID Name Age 12 Arun 60 15 Shreya 24 99 Rohit 11 B ID Name Age 15 Shreya 24 25 Hari 40 98 Rohit 20 99 Rohit 11 C ID Phone Area 10 2200...
Let R and S be relational schemes such that R = { a, b, c } and S = { c }. Now consider the following queries on the database: I. $$\pi_{R-S}(r) - \pi_{R-S} \left (\pi_{R-S} (r) \t...
Let R and S be two relations with the following schema R ( P , Q , R1, R2, R3) S ( P , Q , S1, S2) Where {P, Q} is the key for both schemas. Which of the following queries are equi...
Information about a collection of students is given by the relation studInfo(studId, name, sex) . The relation enroll(studId, courseId) gives which student has enrolled for (or tak...
Consider the following relation schemas : b-Schema = (b-name, b-city, assets) a-Schema = (a-num, b-name, bal) d-Schema = (c-name, a-number) Let branch, account and depositor be res...
Consider a selection of the form σ A ≤ 100(r), where r is a relation with 1000 tuples. Assume that the attribute values for A among the tuples are uniformly distributed in the inte...
Consider the relations r 1 (P, Q, R) and r 2 (R, S, T) with primary keys P and R respectively. The relation r 1 contains 2000 tuples and r 2 contains 2500 tuples. The maximum size...
Which of the following relational query languages have the same expressive power? I) Relational algebra II) Tuple relational calculus restricted to safe expressions III) Domain rel...
Let r be a relation instance with schema R = (A, B, C, D). We define $${r_1} = {\pi _{A,B,C}}\left( r \right)$$ and $${r_1} = {\pi _{A,D}}\left( r \right)$$. Let $$s = {r_1}*{r_2}$...
Let R 1 ( A, B, C) and R 2 ( D, E) be two relation schema, where the primary keys are shown underlined, and let C be a foreign key in R 1 referring to R 2 . Suppose there is no vio...
Consider the following relation schema pertaining to a students database: Students ( rollno , name, address) Enroll( rollno,courseno , coursename) Where the primary keys are shown...
Consider the following SQL query: Select distinct a 1 , a 2 , ..., a n From r 1 , r 2 , ..., r m Where P; For an arbitrary predicate P, this query is equivalent to which of the fol...
With regard to the expressive power of the formal relational query languages, which of the following statements is true?
Given the relations employee (name, salary, deptno) , and department (deptno, deptname, address) Which of the following queries cannot be expressed using the basic relational algeb...
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
The relational algebra expression equivalent to the following tuple calculus expression: $$\left\{ {t|t \in r \wedge \left( {t\left[ A \right] = 10 \wedge t\left[ B \right] = 20} \...
Which of the following query transformations (i.e. replacing the l.h.s. expression by the r.h.s. expression) is incorrect? R 1 and R 2 are relations, C 1 , C 2 are selection condit...
A library relational database system uses the following schema USERS (User #, User Name, Home Town) BOOKS (Books # Book Title, Author Name) ISSUED (Book #, User #, Date) Explain in...
Give a relational algebra expression using only the minimum number of operators from $$\left( { \cup ,\, - } \right)$$ which is equivalent to $$R \cap S$$.