-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
10 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
select ins.identifier, count(u.id) as user_count, (select count(bi.id) from issuer_badgeinstance bi where bi.user_id = u.id ) as assertion_count | ||
select count(u.id) as user_count, (select count(bi.id) from issuer_badgeinstance bi where bi.user_id = u.id ) as assertion_count | ||
from users u | ||
inner join issuer_badgeinstance bi on bi.user_id = u.id | ||
inner join issuer_badgeclass b on b.id = bi.badgeclass_id | ||
inner join issuer_issuer i on i.id = b.issuer_id | ||
inner join institution_faculty f on f.id = i.faculty_id | ||
inner join institution_institution ins on ins.id = f.institution_id | ||
where b.is_micro_credentials = 1 and ins.institution_type is not null | ||
group by assertion_count, ins.identifier | ||
order by ins.identifier ; | ||
group by assertion_count | ||
|
||
select count(bi.id), b.badge_class_type, b.archived from issuer_badgeinstance bi | ||
inner join issuer_badgeclass b on b.id = bi.badgeclass_id | ||
group by b.badge_class_type, b.archived; | ||
group by b.badge_class_type, b.archived; | ||
|
||
select u.email from users u where (u.validated_name is null OR u.validated_name = '') and u.is_teacher = 0 | ||
and exists( | ||
SELECT 1 | ||
FROM issuer_badgeinstance bi INNER JOIN issuer_badgeclass bc | ||
WHERE bi.user_id = u.id AND bc.name <> 'Edubadge account complete' | ||
); |