Spaces:
Runtime error
Runtime error
| import sqlite3 | |
| def init_db(): | |
| conn = sqlite3.connect("study_abroad.db") | |
| cursor = conn.cursor() | |
| cursor.execute(''' | |
| CREATE TABLE IF NOT EXISTS knowledge_base ( | |
| id INTEGER PRIMARY KEY, | |
| category TEXT, | |
| country TEXT, | |
| content TEXT | |
| ) | |
| ''') | |
| data = [ | |
| ("Scholarship", "Germany", "DAAD: Covers living costs. Requirements: GPA > 3.0, German or English proficiency."), | |
| ("University", "Germany", "Technical University of Munich (TUM): Strong in CS. Low tuition fees."), | |
| ("Scholarship", "UK", "Chevening: Fully funded. Requires 2 years work experience and leadership potential."), | |
| ("General", "Canada", "PGWP allows staying up to 3 years after studies to work and gain experience.") | |
| ] | |
| cursor.executemany("INSERT INTO knowledge_base (category, country, content) VALUES (?,?,?)", data) | |
| conn.commit() | |
| conn.close() | |
| print("Database Initialized Successfully.") | |
| if __name__ == "__main__": | |
| init_db() |