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
how to use case expression? : Sql dba
What is sql profiler in oracle?
Is nosql faster than sql?
Can you select everything, but 1 or 2 fields, without writer's cramp?
Does user triggers have entry for trigger with compilation errors?
How do you respond to dementia behavior?
How can I speed up sql query?
Explain how you can copy a file to file content and file to pl/sql table in advance pl/sql?
How do you update a sql procedure?
How many indexes can be created on a table in sql?
Explain what is rdbms?
What is the difference between numeric and autonumber?
What is use of term?
Explain the methods used to protect source code of pl/sql.
What is cursor explain with example?