def generate_query(query_tuples):
    """
    Builds a query from a list of tuples.

    :param List query_tuples: Lists of tuples to build query item.
    :return: SQL compatible query as a string.
    """
    # prepend ID and date items
    master_query = ("ID integer PRIMARY KEY ASC NOT NULL,"
                    "date text,")
    for name in query_tuples:
        master_query += '%s %s,' % (name[0], name[1])
    return master_query[:-1]