Table Student has 3 columns,Student_id,Student_Name &
Course_Id. Table Course has 2 columns, Course_Id &
Course_Name.Write a query to listdown all the Courses and
number of student in each course.
Answer Posted / kalyan
SELECT COURSE_NAME,COUNT(B.STUDENT_ID) NO_OF_STUDENTS
FROM COURSE A LEFT OUTER JOIN STUDENT B
USING (COURSE_ID)
GROUP BY A.COURSE_NAME
OR
SELECT COURSE_NAME,COUNT(B.STUDENT_ID) NO_OF_STUDENTS
FROM COURSE A , STUDENT B
WHERE A.COURSE_ID = B.COURSE_ID(+)
GROUP BY A.COURSE_NAME
This will list all the courses with no of students
Is This Answer Correct ? | 8 Yes | 1 No |
Post New Answer View All Answers
Explain locks? : Transact sql
What is the difference between a query and a report?
What is the difference among union, minus and intersect?
What are the sql aggregate functions?
What is fmtonly in sql?
What is scope of pl sql developer in future?
How do I trace sql profiler?
what are the differences between require and include, include_once and require_once? : Sql dba
Is sql a backend language?
How to call a javascript function from pl sql?
What are the different sql commands?
what is sql in mysql? : Sql dba
what are set operators in sql? : Sql dba
what are string data types? : Sql dba
how to start mysql server? : Sql dba