--
-- Host: localhost    Database: SmartHome
-- ------------------------------------------------------


--
-- Table structure for table `BewegingsSensor`
--

CREATE TABLE `BewegingsSensor` (
  `Meting` tinyint(1) DEFAULT NULL,
  `MetingInterval` int(11) DEFAULT NULL,
  `Datum` date DEFAULT NULL,
  `Uur` time DEFAULT NULL,
  `SensorSerieNr` varchar(50) NOT NULL,
  `Huis_HuisId` int(11) NOT NULL,
  KEY `fk_BewegingsSensor_Sensoren1_idx` (`SensorSerieNr`),
  KEY `fk_BewegingsSensor_Huis1_idx` (`Huis_HuisId`),
  CONSTRAINT `fk_BewegingsSensor_Huis1` FOREIGN KEY (`Huis_HuisId`) REFERENCES `Huis` (`HuisId`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_BewegingsSensor_Sensoren1` FOREIGN KEY (`SensorSerieNr`) REFERENCES `Sensoren` (`SensorSerieNr`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `BewegingsSensor`
--

INSERT INTO `BewegingsSensor` VALUES (0,60,'2017-06-12','12:16:00','TY900TT1209',1);

--
-- Table structure for table `Huis`
--

CREATE TABLE `Huis` (
  `HuisId` int(11) NOT NULL AUTO_INCREMENT,
  `Straat` varchar(150) DEFAULT NULL,
  `HuisNr` varchar(3) DEFAULT NULL,
  `Postcode` varchar(45) DEFAULT NULL,
  `Stad` varchar(150) DEFAULT NULL,
  PRIMARY KEY (`HuisId`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `Huis`
--

INSERT INTO `Huis` VALUES (1,'Rodenbergstraat','17','8510','Marke');

--
-- Table structure for table `LED`
--

CREATE TABLE `LED` (
  `Meting` int(11) DEFAULT NULL,
  `MetingInterval` int(11) DEFAULT NULL,
  `Datum` date DEFAULT NULL,
  `Uur` time DEFAULT NULL,
  `HuisId` int(11) NOT NULL,
  `SensorSerieNr` varchar(50) NOT NULL,
  KEY `fk_LED_Huis1_idx` (`HuisId`),
  KEY `fk_LED_Sensoren1_idx` (`SensorSerieNr`),
  CONSTRAINT `fk_LED_Huis1` FOREIGN KEY (`HuisId`) REFERENCES `Huis` (`HuisId`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_LED_Sensoren1` FOREIGN KEY (`SensorSerieNr`) REFERENCES `Sensoren` (`SensorSerieNr`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `LED`
--

INSERT INTO `LED` VALUES (1,10,'2017-06-12','12:16:00',1,'12UYT89'),(1,10,'2017-06-12','12:17:00',1,'12UYT90'),(0,10,'2017-06-12','12:18:00',1,'12UYT91'),(1,10,'2017-06-12','12:18:00',1,'12UYT92');

--
-- Table structure for table `Licht`
--

CREATE TABLE `Licht` (
  `Meting` int(11) DEFAULT NULL,
  `MetingInterval` int(11) DEFAULT NULL,
  `Datum` date DEFAULT NULL,
  `Uur` time DEFAULT NULL,
  `HuisId` int(11) NOT NULL,
  `SensorSerieNr` varchar(50) NOT NULL,
  KEY `fk_Licht_Huis1_idx` (`HuisId`),
  KEY `fk_Licht_Sensoren1_idx` (`SensorSerieNr`),
  CONSTRAINT `fk_Licht_Huis1` FOREIGN KEY (`HuisId`) REFERENCES `Huis` (`HuisId`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_Licht_Sensoren1` FOREIGN KEY (`SensorSerieNr`) REFERENCES `Sensoren` (`SensorSerieNr`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `Licht`
--

INSERT INTO `Licht` VALUES (20,60,'2017-06-12','12:16:00',1,'GH678VT906'),(20,60,'2017-06-12','12:17:00',1,'GH678VT906'),(20,60,'2017-06-12','12:18:00',1,'GH678VT906');

--
-- Table structure for table `Sensoren`
--

CREATE TABLE `Sensoren` (
  `SensorSerieNr` varchar(50) NOT NULL,
  `Type` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`SensorSerieNr`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `Sensoren`
--

INSERT INTO `Sensoren` VALUES ('12UYT89','Licht 1'),('12UYT90','Licht 2'),('12UYT91','licht 3'),('12UYT92','licht 4'),('AB6579VC456','Temperatuur'),('ARTYU4566TT','Deur sensor voordeur'),('ARTYU4586TT','deur sensor garage'),('GH678VT906','lichtsensor'),('TY900TT1209','Bewegingssensor');

--
-- Table structure for table `Temperatuur`
--

CREATE TABLE `Temperatuur` (
  `Meting` int(11) DEFAULT NULL,
  `MetingInterval` int(11) DEFAULT NULL,
  `Datum` date DEFAULT NULL,
  `Uur` time DEFAULT NULL,
  `HuisId` int(11) NOT NULL,
  `SensorSerieNr` varchar(50) NOT NULL,
  KEY `fk_Temperatuur_Huis1_idx` (`HuisId`),
  KEY `fk_Temperatuur_Sensoren1_idx` (`SensorSerieNr`),
  CONSTRAINT `fk_Temperatuur_Huis1` FOREIGN KEY (`HuisId`) REFERENCES `Huis` (`HuisId`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_Temperatuur_Sensoren1` FOREIGN KEY (`SensorSerieNr`) REFERENCES `Sensoren` (`SensorSerieNr`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `Temperatuur`
--

INSERT INTO `Temperatuur` VALUES (20,60,'2017-06-12','12:16:00',1,'AB6579VC456'),(22,60,'2017-06-12','12:17:00',1,'AB6579VC456'),(21,60,'2017-06-12','12:18:00',1,'AB6579VC456');

--
-- Dumping events for database 'SmartHome'
--

--
-- Dumping routines for database 'SmartHome'
--


