Database Viewer

Browse the SQL that builds any database used across the lessons, without running it.

Loaded: Lesson 3 database (Katherine already deleted) ยท insert-update-delete.refresh-after-delete-init

CREATE TABLE users (
  id SERIAL PRIMARY KEY,
  name TEXT NOT NULL,
  email TEXT NOT NULL UNIQUE,
  gender TEXT NOT NULL,
  active BOOLEAN NOT NULL DEFAULT true
);


INSERT INTO users (name, email, gender, active)
VALUES
  ('Ada Lovelace', 'ada@example.com', 'female', true),
  ('Grace Hopper', 'grace@example.com', 'female', true),
  ('Alan Turing', 'alan@example.com', 'male', true),
  ('Katherine Johnson', 'katherine@example.com', 'female', true),
  ('Barbara Liskov', 'barbara@example.com', 'female', true),
  ('Donald Knuth', 'donald@example.com', 'male', true),
  ('John McCarthy', 'john@example.com', 'male', true),
  ('Edsger Dijkstra', 'edsger@example.com', 'male', true);

DELETE FROM users WHERE email = 'katherine@example.com';