Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



Table Student has 3 columns,Student_id,Student_Name & Course_Id. Table Course has 2 columns, C..

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

Table Student has 3 columns,Student_id,Student_Name & Course_Id. Table Course has 2 columns, C..

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

Table Student has 3 columns,Student_id,Student_Name & Course_Id. Table Course has 2 columns, C..

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

Table Student has 3 columns,Student_id,Student_Name & Course_Id. Table Course has 2 columns, C..

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

Table Student has 3 columns,Student_id,Student_Name & Course_Id. Table Course has 2 columns, C..

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

Table Student has 3 columns,Student_id,Student_Name & Course_Id. Table Course has 2 columns, C..

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

Table Student has 3 columns,Student_id,Student_Name & Course_Id. Table Course has 2 columns, C..

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

Table Student has 3 columns,Student_id,Student_Name & Course_Id. Table Course has 2 columns, C..

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

Table Student has 3 columns,Student_id,Student_Name & Course_Id. Table Course has 2 columns, C..

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

Table Student has 3 columns,Student_id,Student_Name & Course_Id. Table Course has 2 columns, C..

Answer / chinnu

SELECT *(Courses,students) FROM Table Student

Is This Answer Correct ?    3 Yes 14 No

Post New Answer

More SQL PLSQL Interview Questions

What is right join sql?

0 Answers  


what command is used to create a table by copying the structure of another table including constraints ?

6 Answers   CMC, eicc,


How did you export data from database to excel file.

1 Answers   TCS,


What are the cursor attributes used in PL/SQL ?

4 Answers  


when MSQL8.0 is in market

0 Answers  


What is a mutating table

5 Answers   TCS, Tech Mahindra,


What is difference between joins and union?

0 Answers  


Can we relate two different tables from two different users in ORACLE,PL/SQL?

4 Answers  


oracle is compiler or interpretter,can any one tell me the answer?

9 Answers   Satyam,


How do you exit in sql?

0 Answers  


how to insert the data through views? The view is depending upon more than two tables? how to update materalized views?

3 Answers   3i Infotech,


Show the cursor attributes of pl/sql.

0 Answers  


Categories