Skip to content

Commit

Permalink
Update BC by student (latest_scrape).sql
Browse files Browse the repository at this point in the history
  • Loading branch information
mhalv authored Sep 8, 2016
1 parent 4bab0b6 commit 79d4f9e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions BC by student (latest_scrape).sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ SELECT DISTINCT
, basecamp_schools.tableau_email AS tableau_email
, basecamp_schools.region AS region
, basecamp_schools.basecamp_mentor AS mentor
, schools.enrollment_group

-- Student
, students.grade_level AS grade_level
Expand All @@ -18,16 +19,13 @@ SELECT DISTINCT

FROM
basecamp_site_info AS basecamp_schools

-- Site Table
LEFT OUTER JOIN latest_scrape_sites AS schools
ON schools.dbid = basecamp_schools.site_id

-- Student and Mentors Table
LEFT OUTER JOIN latest_scrape_students AS students
ON students.site_id = basecamp_schools.site_id
AND students.visibility = 'visible'
AND students.still_enrolled = TRUE
LEFT OUTER JOIN latest_scrape_sites AS schools
ON schools.dbid = basecamp_schools.site_id
AND schools.as_of = students.as_of
LEFT OUTER JOIN latest_scrape_teachers AS mentors
ON mentors.dbid = students.mentor_id

Expand Down

0 comments on commit 79d4f9e

Please sign in to comment.