-- 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 sellers ( id INTEGER NOT NULL PRIMARY KEY, name VARCHAR(30) NOT NULL, rating INTEGER NOT NULL ); CREATE TABLE items ( id INTEGER NOT NULL PRIMARY KEY, name VARCHAR(30) NOT NULL, sellerId INTEGER, FOREIGN KEY (sellerId) REFERENCES sellers(id) ); INSERT INTO sellers(id, name, rating) VALUES(1, 'Roger', 3); INSERT INTO sellers(id, name, rating) VALUES(2, 'Penny', 5); INSERT INTO items(id, name, sellerId) VALUES(1, 'Notebook', 2); INSERT INTO items(id, name, sellerId) VALUES(2, 'Stapler', 1); INSERT INTO items(id, name, sellerId) VALUES(3, 'Pencil', 2); -- Expected output (in any order): -- Item Seller -- ---------------- -- Notebook Penny -- Pencil Penny