Skip to content
Advertisement

SQL Query Problem: How Many Students have one or more blood donations in 2016?

I am a high school student and am currently working on an exercise about SQL, which is this query that made me stuck for an hour and still couldn’t solve it. The table schema is as follows:

Table

enter image description here

The question my teacher gave me was: How any Students have one or more blood donations in 2016?
Thanks for any generous help. The SQL I tried to run is

And I still couldn’t figure out how to COUNT the number of students.

Advertisement

Answer

You can join both the tables and use the keyword DISTINCT to find DISTINCT students-

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement