def sqlite3_column_affinity(column_type):
    """Return the sqlite3 column affinity corresponding to a type string."""
    ct = column_type.lower()
    if "int" in ct:
        return "INTEGER"
    elif "char" in ct or "clob" in ct or "text" in ct:
        return "TEXT"
    elif "blob" in ct or ct == "":
        return "NONE"
    elif "real" in ct or "floa" in ct or "doub" in ct:
        return "REAL"
    else:
        return "NUMERIC"