For your second question List details for the members which have the most presently borrowed copies. Series the output alphabetically by member name
Code:
select * from Memb where Membno in (select MembNo from DVDCopy group by MembNo having count (MembNum) = (select max (cnt) from (select MembNum, count (MembNum) cnt from dvdcopy
group by Membnum))) order by name asc;
Once more, if I have read the query properly. There is possibly a more stylish way of doing this, but mainly I have completed a count of all the DVDs grouped by Membnum, and after that linked this over to the member table. Thinking regarding it though you will possibly require to discount too so:
Code:
select * from Memb where Membno in (select MembNo from DVDCopy group by MembNo having count(MembNum) = (select max(cnt) from (select MembNum, count(MembNum) cnt from DVDCopy where MembNum is not null group by membnum))) order by name asc;
Let me know how mistaken these are.
Bookmarks