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 / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which version of sql do I have?

747


Is sql easier than java?

734


What is the difference between an inner join and an outer join?

716


What is the difference between nvl function, ifnull function, and isnull function?

796


What is the purpose of the partition table?

753






What does joining a thread mean?

753


What is foreign key sql?

746


Can variables be used in sql statements?

747


How does postgresql compare to mysql?

761


What are local and global variables and their differences?

810


What are different types of keys?

737


What is raid? How does it help storage of databases?

798


What is normalization in a database?

848


a table has 2 classifications 1)liabilities 2)earnings this liabitity has 2 elements with 2 input values and the earnings have 2 elements with 2 input values i wrote a query so that my input is liability savings amount1 amount2 xxxx null xxxxxx 0 xxx1 null xxxxx1 0 null yyyy 0 yyyy null yyy1 0 yyy1 my problem is --when i developed a report(d2k) with this data my o/p is liabilities,amount1,savings,amount2 xxxx xxxxxx xxx1 xxxxx1 yyyy yyyy yyy1 yyy1 how could i move this savings,savings values 2 palces up. can any body provide me witha better solution

1949


What is sql partition?

752