What scritping language are you using on your server (PHP, Java, ASP.net, 
other)?  That will dictate the mechanics of building your table.

The SQL query is simple:

SELECT a.student_name, COUNT(b.assignment_id) AS assignments FROM students 
AS a LEFT JOIN assignments AS b ON (a.student_id = b.student_assignment_id) 
GROUP BY a.student_name

On Friday, March 29, 2013 9:29:50 AM UTC-4, melm wrote:
>
> Hi,
> So I'd like to create a bar chart which takes data from my 2 mysql tables
> the first one is students table:
>
> student_id(PK), student_name
>
> the second one is assignments table
>
> assignment_id (PK), assignment_name, student_assignment_id (FK)
>
> all students get assigned to work on a specific assignment therefore the 
> student_assignment_id FK references the student_id column in the students 
> table.
>
> I'd like to show all the assignment counts that are assigned to each 
> student in my students table so it should look like this
>
>
> <https://lh6.googleusercontent.com/--uh_x8jcfHM/UVWXAhzyGBI/AAAAAAAAAAs/xq9Wf3OvPyE/s1600/barchart.bmp>
>
> Can someone please help? Thanks in advance
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to