SQL for list of completed courses of a specific user (course completion)

SQL for list of completed courses of a specific user (course completion)

by Mitja Decman -
Number of replies: 1

Hi,

I am no SQL pro but I would just like to create an SQL that would list rows of user's courses and course completion status "where prefix_user.username=xxx".

Can someone give me a hint, thanks...

Mitja

Average of ratings: -
In reply to Mitja Decman

Odg: SQL for list of completed courses of a specific user (course completion)

by Mitja Decman -

well, this one I come up with:

SELECT u.username, c.* , co.fullname FROM prefix_user u, prefix_course_completions c, prefix_course co WHERE u.id=c.userid and co.id=c.course and username='xxxxxx';

So, if time completed is not null, then course is complete.

But it would also be nice to see something like number of completed activities / number of all activities that have to be completed...