ORACLE INTERVIEW QUESTION | How to Assign Row Numbers Without ROW_NUMBER() Function
-- Create the employees table
DROP TABLE IF EXISTS employees;
CREATE TABLE employees (
department_id INT,
employee_id INT,
name VARCHAR(50)
);
-- Insert sample data into the employees table
INSERT INTO employees (department_id, employee_id, name) VALUES
(1, 1, 'Anna'),
(1, 2, 'Ben'),
(2, 3, 'Charlie'),
(2, 4, 'David'),
(1, 5, 'Eva'),
(3, 6, 'George'),
(3, 7, 'John');
SELECT * FROM employees
Comments
Post a Comment