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.
Answers were Sorted based on User's Feedback
Answer / monalisa.dalbehera
select count(s.student_id),c.cource_name
from student s,course c
where c.course_id=s.course_id
group by c.course_name;
| Is This Answer Correct ? | 48 Yes | 3 No |
Answer / pradip d
select count(student_name),course_name from student,course
where course.course_id=student.course_id group by course_name;
| Is This Answer Correct ? | 18 Yes | 8 No |
Answer / 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 |
Answer / neo28
select Course_Id, Course_Name, count(Student_id) from
(
select c.Course_Id, c.Course_Name, s.Student_id
from Student s, Course c
where s.Course_Id(+) = c.Course_Id
) group by Course_Id
order by Course_Id;
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / iamanocp
select c.course_id, count(s.student_id)
from student s, course c
where s.course_id = c.course_id
group by c.course_id;
| Is This Answer Correct ? | 2 Yes | 2 No |
Answer / lova raju allumalla
select count(stud_name),course_name from student s,course c
where s.course_id = c.course_id group by course_name
/
| Is This Answer Correct ? | 2 Yes | 2 No |
Answer / cm
select s.stud_name,c.course_name from student s,course c
where s.course_id = c.course_id group by
s.stud_name,c.course_name;
| Is This Answer Correct ? | 1 Yes | 2 No |
Answer / dinakar
select course_id,count(*) from student where course_id in
(select course_id From course)
GROUP BY COURSE_ID
| Is This Answer Correct ? | 2 Yes | 4 No |
Answer / guest
select count(student_id),course_name ,student_name
from student s, course c
where s.course_id = c.course_id
group by course_id
order by student_id desc
| Is This Answer Correct ? | 2 Yes | 5 No |
How to fix oracle error ora-00942: table or view does not exist
how to create a primary key with out creating an index?
how to find the second highest salary from emp table?
211 Answers CIS, Cognizant, Cosmosoft, DAS, EDS, GreenTech, HOV Services, IBM, Infosys, National Institute of Science and Technology, Patni, Persistent, Polaris, TCS, Wipro, Yardi, Zensar,
How many rows will return from dual table?
Can we use pl sql in mysql?
What is a merge query?
What is the difference between an inner join and an outer join?
How do you write a subquery?
Is inner join same as self join?
Hello All, Could any well write a query for the following scenario. Account(table name) No Name Amount 1 ABCD 2000.00 2 DEFG -2000.00 3 GHIJ 3000.50 4 JKLM 4000.00 5 MNOP 6000.00 O/p Should be in this format No Name Credit Debit 1 ABCD 2000.00 0 2 DEFG 0 -2000.00 3 GHIJ 3000.50 4 JKLM 0 -4000.00 5 MNOP 6000.00 o could any one give appropriate query for this Thnks in Advance Suneel Reddy
I have one Excel file with 1,50,000 Records. Now I need to load that whole file into Oracle Database with same columns in Excel sheet . I need PLSQL Procedure or used by SQL PLUS
Which column in the user.triggers data dictionary view shows that the trigger is a pl/sql trigger?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)