CREATE TABLE "osoba" (
  "id" SERIAL PRIMARY KEY,
  "jmeno" VARCHAR(50) NOT NULL,
  "rok_narozeni" INTEGER NOT NULL CHECK (rok_narozeni > 1900),
  "poznamka" VARCHAR(250),
  "zamestnani" INTEGER
);

CREATE TABLE "konicek" (
  "id" SERIAL PRIMARY KEY,
  "nazev" VARCHAR(30) UNIQUE NOT NULL
);

CREATE TABLE "zamestnani" (
  "id" SERIAL PRIMARY KEY,
  "nazev" VARCHAR(30) UNIQUE NOT NULL
);

CREATE TABLE "konicek_osoby" (
  "id" SERIAL PRIMARY KEY,
  "osoba" INTEGER NOT NULL,
  "konicek" INTEGER NOT NULL
);

-------------------------------------------------------------

ALTER TABLE tabulka ADD PRIMARY KEY (id);
ALTER TABLE tabulka ADD UNIQUE (jmeno);

ALTER TABLE tabulka ALTER jmeno SET NOT NULL ;

ALTER TABLE tabulka DROP COLUMN sloupec;
ALTER TABLE tabulka ADD navrat_dluhu DATE DEFAULT current_date+10;

