Hi! Could we please enable some services and cookies to improve your experience and our website?

SQLize | PHPize | SQLtest

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

A A A
Login    Share code      Blog   FAQ
Copy Format Clear
CREATE TABLE Employee ( employee_id INT , employee_name VARCHAR(50), department_id INT, lposition VARCHAR(50), salary DECIMAL(10, 2) ); INSERT INTO Employee (employee_id, employee_name, department_id, lposition, salary) VALUES (1, 'Alice Johnson', 101, 'Software Engineer', 70000), (2, 'Bob Smith', 102, 'Data Scientist', 80000), (3, 'Carol White', 103, 'Project Manager', 75000), (4, 'David Brown', 104, 'Quality Assurance', 60000), (5, 'Eva Green', 105, 'HR Specialist', 55000), (6, 'Frank Martin', 101, 'Software Engineer', 70000), (3, 'Carol White', 103, 'Project Manager', 75000), (4, 'David Brown', 104, 'Quality Assurance', 60000); select * from Employee -- query 3. write a query to find out highest earning employee based on each position select lposition,count(employee_name)as employee, count(salary)as salary from Employee group by lposition,employee_name;

Stuck with a problem? Got Error? Ask AI support!

Copy Clear