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.

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


Please Help Members By Posting Answers For Below Questions

How can we avoid duplicating records in a query?

958


What is the use of partition by in sql?

976


Is pl sql a programming language?

964


what are the 'mysql' command line arguments? : Sql dba

1121


Which data type is a composite type?

974


What are the parameter modes supported by pl/sql?

1081


What is numeric function sql?

1043


Why is nosql good?

1006


The select into statement is most often used to create backup copies of tables or for archiving records?

1055


Can you call pl/sql package functions from within a fast formula?

1021


Explian rowid, rownum?

995


How do you select unique values in sql?

980


what is a database lock ? : Sql dba

1151


Can we join same table in sql?

999


Inline the values in PL/SQL, what does it mean.?

1203