first commit

This commit is contained in:
2026-06-23 15:04:46 +02:00
committed by Nathan Tien You
commit e1d64997c7
11 changed files with 607 additions and 0 deletions
Executable
+31
View File
@@ -0,0 +1,31 @@
import sqlite3
conn = sqlite3.connect("Goonerdle.db")
cursor = conn.cursor()
cursor.execute("""
CREATE TABLE Score (
Score_ID INTEGER PRIMARY KEY AUTOINCREMENT,
Result_ID INTEGER,
Position INTEGER,
isCorrect INTEGER NOT NULL CHECK (isCorrect IN (0,1)),
FOREIGN KEY (Result_ID) REFERENCES Result(Result_ID)
);
""")
cursor.execute("""
CREATE TABLE Result (
Result_ID INTEGER PRIMARY KEY AUTOINCREMENT,
User_ID INTEGER NOT NULL,
DateScore DATE NOT NULL,
Result INTEGER NOT NULL,
UNIQUE (User_ID, DateScore)
);
""")
conn.commit()
conn.close()
print("Database and tables created successfully!")