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
# Sync Data From sasthrolsavamDB to KalolsavamDB | |
# ============================================== | |
# Insert school details from another db | |
INSERT INTO `kalolsavam_2013`.`school_details` | |
(`school_code`, `class_start`, `class_end`, `school_phone`, `school_email`, | |
`hm_name`, `hm_phone`, `principal_name`, `principal_phone`, | |
`teachers`, `strength_lp`, `strength_up`, `strength_hs`, | |
`strength_hss`, `strength_vhss`, `total_strength`, |
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
SELECT pid.participant_name, sm.school_name, pid.item_code, im.item_name, rm.rank | |
FROM result_master AS rm | |
JOIN participant_item_details AS pid ON pid.participant_id = rm.participant_id | |
JOIN school_master AS sm ON sm.school_code = pid.school_code | |
JOIN item_master as im on im.item_code = rm.item_code | |
WHERE rm.`spo_id` > 0 | |
AND rm.`rank` in (1, 2, 3) | |
order by rm.rank; |
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
#1 schools | |
select | |
RM.rev_district_name, | |
count(CASE WHEN SD.class_end IN (4, 5) and S.school_type='G' THEN SD.school_code END ) AS GovPrimarySchools, | |
count(CASE WHEN SD.class_end IN (4, 5) and S.school_type='A' THEN SD.school_code END ) AS AidPrimarySchools, | |
count(CASE WHEN SD.class_end IN (4, 5) and S.school_type='U' THEN SD.school_code END ) AS AidPrimarySchools, | |
count(CASE WHEN SD.class_end =7 and S.school_type='G' THEN SD.school_code END ) AS GovUpperPrimarySchools, | |
count(CASE WHEN SD.class_end =7 and S.school_type='A' THEN SD.school_code END ) AS AidUpperPrimarySchools, | |
count(CASE WHEN SD.class_end =7 and S.school_type='U' THEN SD.school_code END ) AS AidUpperPrimarySchools, | |
count(CASE WHEN SD.class_end IN (8, 9, 10) and S.school_type='G' THEN SD.school_code END ) AS GovSecondarySchools, |
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
<?php | |
class User_model extends CI_Model { | |
function __construct() | |
{ | |
parent::__construct(); | |
} | |
/** | |
* authenticate user login |
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
#!/bin/bash | |
# change docRoot | |
docRoot=~/src/shakir/ | |
for semester in */; | |
do | |
semester="${semester%?}" | |
cd "$docRoot/$semester/" | |
for branch in */; |
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
#!/bin/bash | |
credentials='' | |
database='' | |
TABLES=`mysql $credentials -B -N -e "select TABLE_NAME from information_schema.TABLES where TABLE_SCHEMA='$database'"` | |
for table in $TABLES; do | |
echo -n "dumping $database.$table... " | |
if [[ $table == cache* ]]; then |
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
### Keybase proof | |
I hereby claim: | |
* I am rashivkp on github. | |
* I am rashivkp (https://keybase.io/rashivkp) on keybase. | |
* I have a public key whose fingerprint is D11F 7E91 320B 8862 F266 4987 85A3 0001 E0EC 2C29 | |
To claim this, I am signing this object: |
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
:g/\v^Insert into DISE2K_|^Insert into STEPS_R|^Insert into CHK_TABLE|^Insert into RTE_COMPLAINT|^Insert into SCH_TEMP|^Insert into SCH_TEMP1|^Insert into STEPS_AUTH|^Insert into STEPS_CWSNCHILDDB|^Insert into STEPS_DATE|^Insert into STEPS_DBINFO|^Insert into STEPS_DCF2PRINT|^Insert into STEPS_DISTPHASE|^Insert into STEPS_PIVOT|^Insert into STEPS_POP4COMPRATE|^Insert into STEPS_POPULATION_ALL|^Insert into STEPS_PRINTDCF|^Insert into STEPS_QUERY|^Insert into STEPS_RMSASUBJECTS|^Insert into STEPS_R_ANAREPBYMCR|^Insert into STEPS_R_ANAREPINFO|^Insert into STEPS_R_ENRBYMCR_SCR|^Insert into STEPS_R_EREPBYMCR|^Insert into STEPS_R_REPINFO|^Insert into STEPS_R_SCHGRADE|^Insert into STEPS_R_SREPBYMCR|^Insert into STEPS_R_TREPBYMCR|^Insert into STEPS_SCHBYCATMGT|^Insert into STEPS_SCHGRADING|^Insert into STEPS_TEACHER_RTE|^Insert into STEPS_TEHSIL|^Insert into STEPS_TOTDISABILITY|^Insert into STEPS_TOTENROLMENT|^Insert into STEPS_TOTPINCENTIVES|^Insert into STEPS_TOTUINCENTIVES/d | |
:g/^--/d | |
:g/^ ALTER TABLE/d | |
:g/^ UNI |
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
select distinct student, date, sum(if(ifnull(k1.hour, 0)>0, 1, 0)) as fornoon, | |
sum(if(ifnull(k2.hour, 0)>0, 1, 0)) as afternoon from t1 | |
left join t1 k1 on k1.student=t1.student, k1.date=t1.date and hour between 1, 4 | |
left join t1 k2 on k2.student=t1.student, k2.date=t1.date and hour between 5, 7 | |
; another approach, not tested | |
SELECT student, date | |
count(CASE WHEN t1.hour between 1,4 THEN 1 END ) AS fornoon, |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer