Skip to content

Latest commit

 

History

History
18 lines (16 loc) · 467 Bytes

readme.md

File metadata and controls

18 lines (16 loc) · 467 Bytes

Expected .sql format

CREATE TABLE type (
  id INT PRIMARY KEY,
  name VARCHAR(50) NOT NULL
);
CREATE UNIQUE INDEX idx_type_name ON type (name);

CREATE TABLE status (
  id INT PRIMARY KEY,
  type_id INT NOT NULL,
  name VARCHAR(50) NOT NULL,
  FOREIGN KEY (type_id) REFERENCES type(id)
);
CREATE UNIQUE INDEX idx_status_type_id_name ON status (type_id, name);

So, as we can see the create index command should be below the create create table command.