18 lines
502 B
Plaintext
18 lines
502 B
Plaintext
|
USE arduino;
|
||
|
|
||
|
CREATE TABLE sensoren (
|
||
|
id INT AUTO_INCREMENT PRIMARY KEY,
|
||
|
bezeichnung varchar(256)
|
||
|
);
|
||
|
|
||
|
insert into sensoren (id, bezeichnung) VALUES (1, "Decke");
|
||
|
insert into sensoren (id, bezeichnung) VALUES (2, "Heck");
|
||
|
insert into sensoren (id, bezeichnung) VALUES (3, "Front");
|
||
|
|
||
|
CREATE TABLE sensordaten (
|
||
|
id INT AUTO_INCREMENT PRIMARY KEY,
|
||
|
timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||
|
temperatur FLOAT,
|
||
|
sensor_id INT,
|
||
|
FOREIGN KEY (sensor_id) REFERENCES sensoren(id)
|
||
|
);
|