-- Create the SchoolA table
CREATE TABLE SchoolA (
    student_id INT,
    student_name VARCHAR(255)
);

-- Insert data into the SchoolA table
INSERT INTO SchoolA (student_id, student_name)
VALUES
    (1, 'Alice'),
    (2, 'Bob');

-- Create the SchoolB table
CREATE TABLE SchoolB (
    student_id INT,
    student_name VARCHAR(255)
);

-- Insert data into the SchoolB table
INSERT INTO SchoolB (student_id, student_name)
VALUES
    (3, 'Tom');

-- Create the SchoolC table
CREATE TABLE SchoolC (
    student_id INT,
    student_name VARCHAR(255)
);

-- Insert data into the SchoolC table
INSERT INTO SchoolC (student_id, student_name)
VALUES
    (3, 'Tom'),
    (2, 'Jerry'),
    (10, 'Alice');

SELECT a.student_name,b.student_name,c.student_name
FROM SchoolA a
JOIN SchoolB b
ON a.student_id <> b.student_id
AND 
a.student_name <> b.student_name
JOIN SchoolC c
ON c.student_id <> b.student_id
AND 
b.student_name <> c.student_name
AND
c.student_id <> a.student_id
AND 
a.student_name <> c.student_name

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: