CREATE TABLE mackarol (
  idmackarol VARCHAR(17)  NOT NULL  ,
  nome VARCHAR(50)  NULL  ,
  ativo BOOL  NULL    ,
PRIMARY KEY(idmackarol));



CREATE TABLE painelkarol (
  idpainelkarol INTEGER UNSIGNED  NOT NULL   AUTO_INCREMENT,
  mackarol_idmackarol VARCHAR(17)  NOT NULL  ,
  nome VARCHAR(50)  NULL  ,
  ledr INTEGER UNSIGNED  NULL  ,
  ledg INTEGER UNSIGNED  NULL  ,
  ledb INTEGER UNSIGNED  NULL  ,
  linhaum VARCHAR(50)  NULL  ,
  linhadois VARCHAR(50)  NULL  ,
  datainicial DATE  NULL  ,
  datafinal DATE  NULL    ,
  pressao INTEGER UNSIGNED  NULL ,
  velocidade INTEGER UNSIGNED  NULL ,
  altura INTEGER UNSIGNED  NULL ,
PRIMARY KEY(idpainelkarol)  ,
INDEX painelkarol_FKIndex1(mackarol_idmackarol),
  FOREIGN KEY(mackarol_idmackarol)
    REFERENCES mackarol(idmackarol)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION);




