Skip to content

Instantly share code, notes, and snippets.

View kyogesh's full-sized avatar

Yogesh Kumar kyogesh

  • EPAM India
  • Hyderabad
View GitHub Profile
@kyogesh
kyogesh / gist:34cf0246b0d844acf35d
Created July 28, 2015 07:04
student_id ='481105362'
student_id | term_id |
------------+---------+
481105362 | 199803 |
481105362 | 199808 |
481105362 | 199905 |
481105362 | 199908 |
481105362 | 200005 |
@kyogesh
kyogesh / gist:221890066c939d688af3
Created July 22, 2015 11:05
cumulative_gpa contains college_cd
workbooks=# select yr1_cumulative_gpa from historical_analytics_finaltable ;
yr1_cumulative_gpa
--------------------
BU
AS
HS
BU
AS
BU
BU
workbooks=# select distinct(standard_term.term_id) from student_major_term, standard_term where student_id='334244614' and standard_term.term_id=student_major_term.term_id and not period_type='Summer';
term_id
---------
199808
199901
199908
200001
200008
200401
200901
select distinct(standard_term.term_id) from student_course_term, standard_term where student_id='334244614' and standard_term.term_id=student_course_term.term_id and not period_type='Summer';
term_id
---------
199808
199901
199908
200001
200008
(5 rows)
@kyogesh
kyogesh / gist:1b277449317a96bfc9d9
Created July 22, 2015 09:35
total terms registered excluding summer
workbooks=# select distinct(term_id) from student_course_term where student_id='334244614';
term_id
---------
199905
199901
200005
200008
199908
199808
200001
@kyogesh
kyogesh / gist:61d31852be2722300da3
Created July 22, 2015 08:01
test_analytics failure
File "test_analytics.py", line 133, in test_total_terms_registered
self.assertEqual(self._get('total_terms_registered', '213210964'), 10)
AssertionError: 12L != 10
----------------------------------------------------------------------
Ran 30 tests in 204.711s
FAILED (failures=1)
@kyogesh
kyogesh / gist:cd7e483ca7d2c0988001
Created July 22, 2015 07:57
total term registered test
workbooks=# select count(term_id) from student_course_term where student_id='213210964' group by term_id;
count
-------
1
1
2
2
2
1
2