CREATE TABLE food
(
name VARCHAR(12) NOT NULL, quantity INT NOT NULL, PRIMARY KEY (name)
);
CREATE TABLE species
(
name VARCHAR(12) NOT NULL, location VARCHAR(12) NOT NULL, diet VARCHAR(12) NOT NULL, PRIMARY KEY (name), FOREIGN KEY (diet) REFERENCES food(name)
);
CREATE TABLE pets
(
name VARCHAR(12) NOT NULL, sex VARCHAR(1) NOT NULL, species VARCHAR(12) NOT NULL, color VARCHAR(8) NOT NULL, PRIMARY KEY (name), FOREIGN KEY (species) REFERENCES species(name));
(
name VARCHAR(12) NOT NULL, quantity INT NOT NULL, PRIMARY KEY (name)
);
CREATE TABLE species
(
name VARCHAR(12) NOT NULL, location VARCHAR(12) NOT NULL, diet VARCHAR(12) NOT NULL, PRIMARY KEY (name), FOREIGN KEY (diet) REFERENCES food(name)
);
CREATE TABLE pets
(
name VARCHAR(12) NOT NULL, sex VARCHAR(1) NOT NULL, species VARCHAR(12) NOT NULL, color VARCHAR(8) NOT NULL, PRIMARY KEY (name), FOREIGN KEY (species) REFERENCES species(name));