edited by
1,200 views
1 votes
1 votes

Class(name, meets_at, room, fid)

Faculty(fid, fname, deptid)

Find the names of faculty members who teach in every room in which some class is taught

edited by

3 Answers

0 votes
0 votes

Faculty table:

Classroom table:

Result table:

SQL query :

select fname from faculty NATURAL JOIN classroom group by faculty.fid 
    having count(fid)=(select count(distinct room) from classroom);

 

 

Related questions

0 votes
0 votes
1 answer
3
rayhanrjt asked Jan 6, 2023
717 views
Write SQL command to find DepartmentID, EmployeeName from Employee table whose average salary is above 20000.
2 votes
2 votes
1 answer
4
Subhrangsu asked Jun 18, 2022
431 views
Write SQL query to show all employees hired on June 4,1984 (non-default format)emp(empno,ename,job,mgr,hiredate,sal,comm,deptno)