@classmethod
def table_name(cls, table):
    """
        Produces the sql for a table's name, taking into account aliases.
        """
    name = cls.identifier(table.name)
    if table.alias:
        return cls.format('{} as {}', name, cls.identifier(table.alias))
    return name
