Consider the relational database with the following four schemas and their respective instances.
Student( $$\underline {sNo} $$ , sName, dNo) Dept( $$\underline {dNo} $$ , dName)
Course( $$\underline {cNo} $$ , cName, dNo) Register( $$\underline {sNo} $$ , $$\underline {cNo} $$ )
SQL Query :
SELECT * FROM Student AS S WHERE NOT EXIST
(SELECT cNo FROM Course WHERE dNo = "D01"
EXCEPT
SELECT cNo FROM Register WHERE sNo = S.sNo)
The number of rows returned by the above SQL query is _____________.
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
The primary key of the Student table is Roll_no. For the Performance table, the columns Roll_no. and Subject_code together from the primary key. Consider the SQL query given below:
SELECT S.Student_name, sum (P.Marks)
FROM Student S, Performance P
WHERE P.Marks > 84
GROUP BY S.Student_name;
The number of rows returned by the above SQL query is _____.
water_schemes | ||
---|---|---|
scheme_no | district_name | capacity |
1 | Ajmer | 20 |
1 | Bikaner | 10 |
2 | Bikaner | 10 |
3 | Bikaner | 20 |
1 | Churu | 10 |
2 | Churu | 20 |
1 | Dungargarh | 10 |
The number of tuples returned by the following $$SQL$$ query is _______________.
with total(name, capacity) as
select district_name, sum(capacity)
from water_schemes
group by district_name
with total_avg(capacity) as
select avg(capacity)
from total
select name
from total, total_avg
where total.capacity ≥ total_avg.capacity