I want to find who is the heaviest borrower among the student and displaying Sname and heavy count.
I have the following tables.
tablename student having attributes SID,Sname,Spho.
tablename sborrow having attributes SID,CDID,borrow_date,return_date.
tablename Cd having attributes CDID,title.
I have executed the following query in Mysql but it gives me only the count properly and name as different.
Query->SELECT Sname,max(Quantity) as stud from (select Sname, count(CDID) as Quantity from student NATURAL JOIN sborrow group by SID) as stud;
please help me.......