給這些查詢試試
select s.name from students s
left join issued i on (s.rollno = i.rollno)
left join bookcopy bc on (i.copyid = bc.copyid)
left join books b on (bc.bookid = b.bookid)
left join category c on (b.catid = c.catid and c.catname = 'Poetry')
where c.catid is null
select s.name, count(*) as from students s
left join issued i on (s.rollno = i.rollno)
group by s.name
having count(*) > 5
select s.name, b.title, a.authorname, i.issuedate from students s
left join issued i on (s.rollno = i.rollno)
left join bookcopy bc on (i.copyid = bc.copyid)
left join books b on (bc.bookid = b.bookid)
left join author a on (b.authorid = a.authorid);
請修改您的問題,包括在_text_格式表中的數據,並使其明確的閱讀。 –
請寫下你的方法和你被卡住的地方......這是一個家庭作業嗎? – Zeina