Skip to content

Instantly share code, notes, and snippets.

@javrasya
Created January 2, 2020 13:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save javrasya/ade006545068ae713857d981d0342081 to your computer and use it in GitHub Desktop.
Save javrasya/ade006545068ae713857d981d0342081 to your computer and use it in GitHub Desktop.
-- execute_student_count_report.hql
use mydatabase;
INSERT INTO TABLE student_count_report
SELECT
school.school_name,
count(student.student_id) as cnt
FROM school
LEFT JOIN student on student.school_id = school.school_id
GROUP BY school.school_name;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment