1,529 views

Consider the following table named $\text{Student}$ in a relational database. The primary key of this table is $\text{rollNum}.$

$\text{Student}$
$\begin{array}{|c|l|c|c|} \hline \underline{\text{rollNum}} & \text{name} & \text{gender} & \text{marks} \\ \hline \hline 1 & \text{Naman} & \mathrm{M} & 62 \\ \hline 2 & \text{Aliya} & \mathrm{F} & 70 \\ \hline 3 & \text{Aliya} & \mathrm{F} & 80 \\ \hline 4 & \text{James} & \mathrm{M} & 82 \\ \hline 5 & \text{Swati} & \mathrm{F} & 65 \\ \hline \end{array}$

The $\text{SQL}$ query below is executed on this database.

SELECT *
FROM Student
WHERE gender = 'F' AND
marks  > 65;

The number of rows returned by the query is ___________.

$\color{\red}{\text{DBMS:}}$

Question 1: Degree(Arity) of a Relation

Question 2: SQL question Number of Tuples

Question 3: Primary Index on Data File, Binary Search

By the way, that is not age as per the question in the examination. That is actually the marks obtained by the students. Using Age here makes the question unintentionally funny.

@Vishal_kumar98 Haha, Corrected.

The output of the given SQL query is simply to return the female students whose marks is $>65$. we can also solve by first we retrieve all the female students then we can select marks $>65$.

 ROll Name Marks Gender $1$ Aliya 70 Female $2$ Aliya 80 Female $5$ Swati 65 Female

output is as follows:

 Roll Name Marks Gender $1$ Aliya 70 Female $2$ Aliya 80 Female

So the output of the given query is $2$.

The output of the given SQL query is simply to return the female students whose marks is $>65$. we can also solve by first we retrieve all the female students then we can select marks $>65$.

 ROll Name Marks Gender $2$ Aliya 70 Female $3$ Aliya 80 Female $5$ Swati 65 Female

output is as follows:

 Roll Name Marks Gender $2$ Aliya 70 Female $3$ Aliya 80 Female

So the output of the given query is $2$.