def has_table(table_name, db_engine):
    """
    Checks if a table with table_name is in the database
    :param table_name: Name of the table that needs to be checked
    :param db_engine: Specifies the connection to the database
    :return: True if table with table_name is in the database, False otherwise
    """
    if '.' in table_name:  # received schema.table_name
        return db_engine.has_table(table_name.split('.')[1], schema=table_name.split('.')[0])
    else:  # received plain table_name
        return db_engine.has_table(table_name)