CREATE TABLE people (
	id INTEGER GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1) NOT NULL,
	name VARCHAR(50) NOT NULL,
	surname VARCHAR(100) NOT NULL,
	PRIMARY KEY (id)
);

CREATE TABLE users (
	login VARCHAR(100) NOT NULL,
	password VARCHAR(64) NOT NULL,
	role VARCHAR(5) NOT NULL,
	PRIMARY KEY (login)
);

CREATE TABLE pets (
	id INTEGER GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1) NOT NULL,
	name varchar(50) NOT NULL,
	kind varchar(100) NOT NULL,
	owner INTEGER NOT NULL,
	FOREIGN KEY (owner) REFERENCES people(id) ON DELETE CASCADE,
	PRIMARY KEY (id)
);