CREATE DATABASE normal;
USE normal;

CREATE TABLE sequence(
  name VARCHAR(8) NOT NULL,
  next INT NOT NULL
);

ALTER TABLE sequence
ADD CONSTRAINT pk_sequence PRIMARY KEY (name);

CREATE TABLE bubble(
  id INT NOT NULL,
  x INT NOT NULL,
  y INT NOT NULL,
  r INT NOT NULL,
  inside INT
);
ALTER TABLE bubble
ADD CONSTRAINT pk_bubble PRIMARY KEY (id);

ALTER TABLE bubble
ADD CONSTRAINT fk_bubble
FOREIGN KEY (inside)
REFERENCES Persons(id);

CREATE INDEX index_bubble
ON Persons (id,x,y,inside);
