SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
CREATE TABLE names( id INTEGER PRIMARY KEY, name VARCHAR ); insert into names(id, name) values (1, 'John Doe'), (2, 'Jane Doe'), (3, 'Alice Jones'), (4, 'Bobby Louis'), (5, 'Lisa Romero'); CREATE TABLE results( id INTEGER PRIMARY KEY, event VARCHAR, winner_id integer ); insert into results(id, event, winner_id) values (1, '100 meter dash', 2), (2, '500 meter dash',3), (3, 'cross-country', 2), (4, 'triathalon', null); SELECT * FROM NAMES; SELECT * FROM results; select * from names where id not in( select winner_id from results )

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear