Breaking

Monday, 21 August 2017

SQL - Year wise Student Count

                    SQL - Year wise Student Count



                                     


student is a database table containing whose create DDL is given below.
CREATE TABLE student(id intname VARCHAR(100), department VARCHAR(3), year int);
Write the SQL to list the year wise count of the students.
(The year must be the first column in the resultset. The count of the students belonging to the specific year must be the second column in the resultset).



SQL:


select  year, count(*) from student group by year;


Please do comment If u have any Queries!

1 comment:

Like