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 Employees ( ID int, Name varchar(255), Department varchar(255), ManagerID int ); INSERT INTO Employees VALUES (101, "John", "A", null), (102, "Dan", "A", 101), (103, "James", "A", 101), (104, "Amy", "A", 101), (105, "Anne", "A", 101), (106, "Ron", "B", 101); SELECT * FROM Employees; select name from Employees where ID in (select ManagerID from Employees group by ManagerID having count (*)>=5)

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

Copy Clear