-- Create database and table Werte_BZG for health data tracking

CREATE DATABASE IF NOT EXISTS RXF CHARACTER SET utf8 COLLATE utf8_general_ci;

USE RXF;

CREATE TABLE IF NOT EXISTS Werte_BZG (
  ID INT AUTO_INCREMENT PRIMARY KEY,
  Datum DATE NOT NULL,
  Zeit TIME NOT NULL,
  Zucker INT NULL COMMENT 'Blood sugar in mg/dl',
  Essen TEXT NULL COMMENT 'Meal information',
  Gewicht DECIMAL(5,1) NULL COMMENT 'Weight in kg',
  DruckS INT NULL COMMENT 'Systolic blood pressure in mmHg',
  DruckD INT NULL COMMENT 'Diastolic blood pressure in mmHg',
  Puls INT NULL COMMENT 'Pulse rate',
  INDEX idx_datum_zeit (Datum, Zeit)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
