PRAGMA foreign_keys = ON;

CREATE TABLE users (
    id INTEGER PRIMARY KEY NOT NULL,
    username STRING UNIQUE NOT NULL,
    disabled INTEGER NOT NULL DEFAULT 0,
    banned INTEGER NOT NULL DEFAULT 0
);

CREATE TABLE posts (
    id INTEGER PRIMARY KEY NOT NULL,
    title STRING NOT NULL,
    user_id INTEGER,
    FOREIGN KEY (user_id) REFERENCES users(id)
);

INSERT INTO users
    (username, disabled)
VALUES
    ('foo', 0), ('bar', 1), ('baz', 0);

INSERT INTO posts
    (title, user_id)
VALUES
    ('anon 1', NULL), ('anon 2', NULL),
    ('foo 1', 1), ('foo 2', 1),
    ('bar 1', 2), ('bar 2', 2),
    ('baz 1', 3), ('baz 2', 2)
;

SELECT
    p.id, p.title
FROM
    posts p
LEFT JOIN users u ON p.user_id = u.id
WHERE u.id IS null OR u.disabled = false;

Embed on website

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