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.
emp(empId, name, gender, salary, 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
Consider the following statements S1 and S2 about the relational data model:
S1: A relation scheme can have at most one foreign key.
S2: A foreign key in a relation scheme R cannot be used to refer to tuples of R.
Which one of the following choices is correct?
Suppose the following functional dependencies hold on a relation U with attributes P, Q, R, S, and T :
P → QR
RS → T
Which of the following functional dependencies can be inferred from the above functional dependencies?