Library Search
 

Calendar

Download File
Calendar Approved School Year 2013 - 2014

format: pdf
filename: calendar-approved-2013-14-school-calendar.pdf
size: 19 KB
Table './kauaischools@002eorg/blog_posts' is marked as crashed and last (automatic?) repair failed in

SELECT programs.program_id AS program_id,
mentee_stats.mentee_count,
mentor_stats.mentor_count,
article_stats.article_count,
blog_post_stats.blog_post_count,
blog_comment_stats.blog_comment_count
FROM programs
-- count mentees
LEFT JOIN (
SELECT program_id,
COUNT(mentee_id) AS mentee_count
FROM mentee_programs
WHERE is_candidate = 0
GROUP BY program_id
)
AS mentee_stats ON (mentee_stats.program_id = programs.program_id)
-- count mentors
LEFT JOIN (
SELECT program_id,
COUNT(mentor_id) AS mentor_count
FROM mentor_programs
WHERE is_candidate = 0
GROUP BY program_id
)
AS mentor_stats ON (mentor_stats.program_id = programs.program_id)
-- count cms articles
LEFT JOIN (
SELECT program_id,
COUNT(page_id) AS article_count
FROM cms_program_pages
GROUP BY program_id
)
AS article_stats ON (article_stats.program_id = programs.program_id)
-- count blog posts
LEFT JOIN (
SELECT program_id,
COUNT(post_id) AS blog_post_count
FROM blog_posts
GROUP BY program_id
)
AS blog_post_stats ON (blog_post_stats.program_id = programs.program_id)
-- count blog comments
LEFT JOIN (
SELECT program_id,
COUNT(comment_id) AS blog_comment_count
FROM blog_comments
LEFT JOIN blog_posts ON (blog_comments.post_id = blog_posts.post_id)
GROUP BY program_id
)
AS blog_comment_stats ON (blog_comment_stats.program_id = programs.program_id)
WHERE programs.program_id IN ('40')
GROUP BY program_id