
CREATE TABLE PERSONS (
  PERSON_ID INT AUTO_INCREMENT PRIMARY KEY,
  NAME VARCHAR(80) NOT NULL,
  EMAIL VARCHAR(80),
  AFFILIATION VARCHAR(80),
  HOMEPAGE VARCHAR(80)
);

CREATE TABLE PERSONS_SETS (
  PERSON_ID INT NOT NULL,
  SET_ID INT NOT NULL,
  INDEX ( PERSON_ID ),
  INDEX ( SET_ID )
);

CREATE TABLE SETS (
  SET_ID INT AUTO_INCREMENT PRIMARY KEY,
  SETSTART DATETIME NOT NULL,
  DURATION INT,
  FILENAME VARCHAR(80),
  FILESIZE INT,
  DESCRIPTION VARCHAR(80),
  INFO TEXT,
  KEYWORDS VARCHAR(160),
  DOWNLOADS INT,
  SHOW_ID INT NOT NULL,
  INDEX ( SETSTART ),
  INDEX ( SHOW_ID )
);

CREATE TABLE SHOWS (
  SHOW_ID INT AUTO_INCREMENT PRIMARY KEY,
  PERSON_ID INT,
  SHOWSTART DATETIME NOT NULL,
  DURATION INT,
  STUDIO_ID INT NOT NULL,
  INDEX ( SHOWSTART ),
  INDEX ( STUDIO_ID )
);

CREATE TABLE STUDIOS (
  STUDIO_ID INT AUTO_INCREMENT PRIMARY KEY,
  NAME VARCHAR(80),
  ISLIVE CHAR(1)
);


