mysql - How to count no of student got registered for a particular course for the below two given table? -
enter image description herehere have write sql query in order count number of students registered particular course taking "examseriesname"
user input user interface. using mysql query browser:
the following different table details:
create table tblcourse ( courseid numeric(8) primary key, cname varchar(20), uid numeric(8), numberofyears numeric(8), coursecode varchar(8) ); create table tblstudent ( regid numeric(8) primary key, sid numeric(8), sname varchar(20), year varchar(4), courseid numeric(8), branchid numeric(8), uid numeric(8), collegeid numeric(8) ); create table tblexamseries ( id numeric(8) primary key, monthandyearofexam date, examseriesname varchar(20), serieslastdate date, chalanlastdate date );
sorry yesterday have not mentioned other 2 table. today sir told should correct query sharing ans all. support.
select cname, count(*)
from tblstudent st, tblstudentdetails sd, tblstudentexamregistration tes, tblcourse tc
where
tes.studentid=sd.id , sd.regid=st.regid , st.courseid=tc.courseid , tes.examseriesid='" + examseriesid + "' , st.collegeid='" + collegeid + "' group tc.courseid ;
Comments
Post a Comment