/*CREATE TABLE kunde
(
	id SERIAL PRIMARY KEY,
	vorname CHARACTER VARYING NOT NULL,
	name CHARACTER VARYING NOT NULL,
	email CHARACTER VARYING NOT NULL,
	passwort CHARACTER VARYING NOT NULL
);

CREATE TABLE bestellung
(
	id SERIAL PRIMARY KEY,
	datum DATE
);

CREATE TABLE bestellposition
(
	bestellung_id INTEGER,
	produkt_id INTEGER,
	anzahl INTEGER
);

CREATE TABLE produkte
(
	id SERIAL PRIMARY KEY,
	name CHARACTER VARYING NOT NULL,
	beschreibung CHARACTER VARYING NOT NULL,
	preis NUMERIC(8,2) NOT NULL,
	lagerbestand INTEGER NOT NULL
);*/

CREATE TABLE kunde
(
id INTEGER PRIMARY KEY,
name CHARACTER VARYING NOT NULL,
email CHARACTER VARYING NOT NULL,
password CHARACTER VARYING NOT NULL
);
CREATE TABLE bestellung
(
id INTEGER PRIMARY KEY,
kunde_id INTEGER NOT NULL,
datum DATE NOT NULL
);

CREATE TABLE produkt
(
id INTEGER PRIMARY KEY,
name CHARACTER VARYING NOT NULL,
beschreibung CHARACTER VARYING NOT NULL,
anzahl INTEGER NOT NULL,
preis NUMERIC(8,2) NOT NULL
);
CREATE TABLE bestellung_produkt
(
bestellung_id INTEGER NOT NULL,
produkt_id INTEGER NOT NULL,
anzahl INTEGER NOT NULL
);