The relation scheme given below is used to store information about the employees of a company, where empId is the key and deptId indicates the department to which the employee is assigned. Each employee is assigned to exactly one department.
\[ \text{emp}(\text{empId},\ \text{name},\ \text{gender},\ \text{salary},\ \text{deptId}) \]
Consider the following SQL query:
select deptId, count(*)
from emp
where gender = "female" and salary > (select avg(salary) from emp)
group by deptId; The above query gives, for each department in the company, the number of female employees whose salary is greater than the average salary of
Step 1: Understand the subquery.
The subquery
\[
(\text{select avg(salary) from emp})
\]
computes the average salary over the entire \texttt{emp} table, that is, the average salary of all employees in the company, irrespective of department or gender.
Step 2: Analyze the WHERE clause.
The condition
\[
\text{gender = "female" and salary > (select avg(salary) from emp)}
\]
filters only those employees who are female and whose salary is greater than the company-wide average salary.
Step 3: Role of GROUP BY.
The clause
\[
\text{group by deptId}
\]
groups the filtered female employees by their department and counts them for each department.
Step 4: Final interpretation.
Hence, for each department, the query counts female employees whose salary exceeds the average salary of all employees in the company.
Final Answer: (B)
On a relation named Loan of a bank: 



Consider the following code:
int a;
int arr[] = {30, 50, 10};
int *ptr = arr[10] + 1;
a = *ptr;
(*ptr)++;
ptr = ptr + 1;
printf("%d", a + arr[1] + *ptr);
In the diagram, the lines QR and ST are parallel to each other. The shortest distance between these two lines is half the shortest distance between the point P and the line QR. What is the ratio of the area of the triangle PST to the area of the trapezium SQRT?
Note: The figure shown is representative

Consider the following process information for Shortest Remaining Time First (SRTF) scheduling:
\[ \begin{array}{|c|c|c|} \hline \textbf{Process} & \textbf{Arrival Time (AT)} & \textbf{Burst Time (BT)} \\ \hline P1 & 0 & 10 \\ P2 & 1 & 13 \\ P3 & 2 & 6 \\ P4 & 8 & 9 \\ \hline \end{array} \]Find the turnaround time for each process.