Ejemplo n.º 1
0
def SelectOffenseTypes():
    sql = "SELECT DISTINCT OffenseTypeName FROM OffenseTypes"
    return [x[u'OffenseTypeName'] for x in (read(sql))]
Ejemplo n.º 2
0
def SelectVictimTypes():
    sql = "SELECT DISTINCT VictimType FROM VictimTypes"
    return [ x[u'VictimType'] for x in (read(sql)) ]
Ejemplo n.º 3
0
def SelectBiasMotivation():
    sql = "SELECT DISTINCT BiasMotivation FROM BiasMotivations"
    return [ x[u'BiasMotivation'] for x in (read(sql)) ]
Ejemplo n.º 4
0
def SelectRaces():
    sql = "SELECT DISTINCT Race FROM OffenderRace"
    return [ x[u'Race'] for x in (read(sql)) ]
Ejemplo n.º 5
0
def SelectRaceCount(race):
    sql = "SELECT COUNT(*) as cnt FROM Incidents, OffenderRace WHERE Incidents.OffenderRaceId = OffenderRace.OffenderRaceId AND OffenderRace.Race = '" + race + "'"
    return [ x[u'cnt'] for x in read(sql) ]
Ejemplo n.º 6
0
def SelectTotalIncidents():
    sql = "SELECT COUNT(*) as cnt from Incidents"
    return [ x[u'cnt'] for x in read(sql) ]