求一关系代数表达式(数据库)

如图是关系示意,要求通过此表达式找出去过所有医院的病人,谢谢

select Patient from
(
select DISTINCT Patient,Hospital from DoctorWorksAt t1 left join DoctorSeesPatient t2 on t1.Doctor=t2.Doctor) tt
group by Patient having count(Hospital)=(SELECT COUNT(*) FROM (SELECT DISTINCT Hospital FROM dbo. DoctorWorksAt) tt)
温馨提示:答案为网友推荐,仅供参考
相似回答