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
define sql update statement ? : Sql dba
What is constant in pl sql?
How do I truncate a sql log file?
What is raid? How does it help storage of databases?
How show all rows in sql?
Does sap use sql?
What is partition in sql query?
Can a key be both primary and foreign?
What is the difference between subquery and correlated query?
What is the use of prepared statement?
How many sql commands are there?
What is the use of pl/sql table?
Are ddl triggers fired for ddl statements within a pl/sql code executed using the dbms.sql package?
what are all different types of collation sensitivity? : Sql dba
what is subquery? : Sql dba