db
This commit is contained in:
1 parent
64b129f84a
commit
075cb4a2e9
3 files changed
+44
-12
No files matched your search
+3
-3
@@ -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()
|
||||
+41
-9
@@ -1,10 +1,42 @@
|
||||
DROP TABLE IF EXISTS eintraege;
|
||||
DROP TABLE IF EXISTS vokabeln;
|
||||
|
||||
CREATE TABLE eintraege (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
zeitpunkt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
gaszaehler TEXT DEFAULT "",
|
||||
stromzaehler TEXT DEFAULT "",
|
||||
wasserzaehler TEXT DEFAULT "",
|
||||
wetterinfo TEXT DEFAULT ""
|
||||
);
|
||||
CREATE TABLE vokabeln (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
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.
Reference in new issue
Block a user