Sample Table:-

emp_idemp_namejob_namedep_id
68319KAYLINGPRESIDENT1001
66928BLAZEMANAGER3001
67858SCARLETANALYST2001
63679SANDRINECLERK2001

sql:-

SELECT * 
FROM (
    SELECT * 
    FROM (
        SELECT emp_id,
            emp_name,
            job_name,
            dep_id,
            ROW_NUMBER( ) OVER( ORDER BY dep_id ) AS 'sequence'
        FROM employees
    ) opt
) new

Result:-

emp_idemp_namejob_namedep_idsequence
68319KAYLINGPRESIDENT10011
67858SCARLETANALYST20012
63679SANDRINECLERK20013
66928BLAZEMANAGER30014

Description:-
we use ROW_NUMBER( ) OVER( ORDER BY `column_name` ) AS 'column_name'

In some inner query cases, we can’t use ORDER BY clause.