def SelectOffenseTypes(): sql = "SELECT DISTINCT OffenseTypeName FROM OffenseTypes" return [x[u'OffenseTypeName'] for x in (read(sql))]
def SelectVictimTypes(): sql = "SELECT DISTINCT VictimType FROM VictimTypes" return [ x[u'VictimType'] for x in (read(sql)) ]
def SelectBiasMotivation(): sql = "SELECT DISTINCT BiasMotivation FROM BiasMotivations" return [ x[u'BiasMotivation'] for x in (read(sql)) ]
def SelectRaces(): sql = "SELECT DISTINCT Race FROM OffenderRace" return [ x[u'Race'] for x in (read(sql)) ]
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) ]
def SelectTotalIncidents(): sql = "SELECT COUNT(*) as cnt from Incidents" return [ x[u'cnt'] for x in read(sql) ]