This commit is contained in:
BuildTools committed 2022-11-23 21:35:43 +01:00
1 parent 64b129f84a
commit 075cb4a2e9
3 files changed
+43 -11

No files matched your search

+3 -3
View File
@@ -9,9 +9,9 @@ with open('schema.sql') as f:
cur = connection.cursor()
cur.execute("INSERT INTO eintraege ( gaszaehler, stromzaehler, wasserzaehler, wetterinfo) VALUES ( ?, ?, ?, ?)",
('', '', '127', 'kalt aber oho')
)
# cur.execute("INSERT INTO eintraege ( gaszaehler, stromzaehler, wasserzaehler, wetterinfo) VALUES ( ?, ?, ?, ?)",
# ('', '', '127', 'kalt aber oho')
# )
connection.commit()
connection.close()
+40 -8
View File
@@ -1,10 +1,42 @@
DROP TABLE IF EXISTS eintraege;
DROP TABLE IF EXISTS vokabeln;
CREATE TABLE eintraege (
CREATE TABLE vokabeln (
id INTEGER PRIMARY KEY AUTOINCREMENT,
zeitpunkt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
gaszaehler TEXT DEFAULT "",
stromzaehler TEXT DEFAULT "",
wasserzaehler TEXT DEFAULT "",
wetterinfo TEXT DEFAULT ""
);
vokabel TEXT NOT NULL,
stammform TEXT NOT NULL,
art TEXT NOT NULL,
flexion TEXT NOT NULL,
uebersetzung TEXT NOT NULL,
lektion TEXT NOT NULL,
kommentar TEXT NOT NULL
)
;
INSERT INTO "vokabeln" ("id", "vokabel", "stammform", "art", "flexion", "uebersetzung", "lektion", "kommentar") VALUES (1, 'videre', 'video', 'verb', 'e-konj', 'sehen', '2', 'Testvokabel');
INSERT INTO "vokabeln" ("id", "vokabel", "stammform", "art", "flexion", "uebersetzung", "lektion", "kommentar") VALUES (2, 'fames', 'famis f.', 'substantiv', 'gem.-dekl', 'Armut', '4', 'test');
INSERT INTO "vokabeln"
("vokabel", "stammform", "art", "flexion", "uebersetzung", "lektion", "kommentar")
VALUES
('rarara', 'rararae f.', 'substantiv', 'a.-dekl', 'Rarraium', '4', 'test');
DROP VIEW if exists arten;
CREATE VIEW arten AS
SELECT art FROM vokabeln GROUP BY art;
--SELECT * FROM arten;
DROP VIEW if exists flexionen;
CREATE VIEW flexionen AS
SELECT flexion FROM vokabeln GROUP BY flexion;
--SELECT * FROM flexionen;
DROP VIEW lektionen;
CREATE VIEW lektionen AS
SELECT lektion FROM vokabeln GROUP BY lektion
;
--SELECT * FROM lektionen;
Binary file not shown.