Question: I have a table named `SUMMARY`. I want to write a query to find out the student who has at least one row in the table `SUMMARY`. How to find it? 

```
Name Subject Mark
ABC  ENGLISH  100
ABC  TAMIL    100
DEF  TAMIL    100
GHI  FRENCH   100
GHI  SCIENCE  100
GHI  SOCIAL   100

```

Count gives us the number of rows. But What I need is select a student who has atleast one row

Answer: 
Use GROUP BY and COUNT:

```
SELECT name, count(*) FROM summary GROUP BY name

```

Or, if you need it only for student `ABC`:

```
SELECT count(*) FROM summary WHERE name = 'ABC'

```
the `count() ... group by name` give you how many subject have each student, all those student will have at least one subject.

You need a join between `STUDENT` and `SUMMARY` tables to found which student DOESNT have subject yet.

Now if you want a list of student with at least one subject.

```
SELECT DISTINCT name
FROM summary

```