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 following relational algebra expressions?
-
$\Pi_{a_1, a_2, … a_n} \sigma_p \left(r_1 \times r_2 \times \dots \times r_m\right)$
-
$\Pi_{a_1, a_2, … a_n} \sigma_p \left(r_1 \bowtie r_2 \bowtie \dots \bowtie r_m \right)$
-
$\Pi_{a_1, a_2, … a_n} \sigma_p \left(r_1 \cup r_2 \cup \dots \cup r_m \right)$
-
$\Pi_{a_1, a_2, … a_n} \sigma_p \left(r_1 \cap r_2 \cap \dots \cap r_m \right)$