Relational-Algebra
May 3, 2024Database-Management-System
May 3, 2024Question 7942 – Relational-Algebra
Consider a database that has the relation schema CR(StudentName, CourseName). An instance of the schema CR is as given below.
The following query is made on the database.
T1 ← πCourseName(σStudentName='SA'(CR)) T2 ← CR ÷ T1
The number of rows in T2 is ____________.
Correct Answer: A
Question 21 Explanation:
(1) T1 ← πCourseName(σStudentName = ‘SA’(CR))
The σStudentName = ‘SA’(CR) will produce the following
⇾ The result of T1 ← πCourseName(σStudentName=’SA’(CR)) is
(2) T2 ← CR÷T1
⇾ We see that SA is enrolled for CA, CB and CC.
⇾ T2 will give the StudentNames those who have enrolled for all the CA, C, CC courses. So, the following Students are enrolled for the given 3 courses.
⇾ So, the output of T2 will have 4 rows.
The σStudentName = ‘SA’(CR) will produce the following
⇾ The result of T1 ← πCourseName(σStudentName=’SA’(CR)) is
(2) T2 ← CR÷T1
⇾ We see that SA is enrolled for CA, CB and CC.
⇾ T2 will give the StudentNames those who have enrolled for all the CA, C, CC courses. So, the following Students are enrolled for the given 3 courses.
⇾ So, the output of T2 will have 4 rows.
4
5
6
7
Subscribe
Login
0 Comments