-- Suggested testing environments -- For MS SQL: -- https://sqliteonline.com/ with language set as MS SQL -- For MySQL: -- https://www.db-fiddle.com/ with MySQL version set to 8 -- For SQLite: -- http://sqlite.online/ -- Put the following without '--' at the top to enable foreign key support in SQLite. -- PRAGMA foreign_keys = ON; -- Example case create statement: CREATE TABLE employees ( id INTEGER NOT NULL PRIMARY KEY, managerId INTEGER, name VARCHAR(30) NOT NULL, FOREIGN KEY (managerId) REFERENCES employees(id) ); INSERT INTO employees(id, managerId, name) VALUES(1, NULL, 'John'); INSERT INTO employees(id, managerId, name) VALUES(2, 1, 'Mike'); -- Expected output (in any order): -- name -- ---- -- Mike -- Explanation: -- In this example. -- John is Mike's manager. Mike does not manage anyone. -- Mike is the only employee who does not manage anyone.