File size: 981 Bytes
cffeaa1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import sqlite3
import os

# Ensure the database folder exists
os.makedirs("database", exist_ok=True)

# Full path for government.db
db_path = "database/government.db"
conn = sqlite3.connect(db_path)
cursor = conn.cursor()

# Create table for customer PR status
cursor.execute('''
CREATE TABLE IF NOT EXISTS pr_details (
    id TEXT PRIMARY KEY,
    name TEXT,
    email TEXT,
    pr_status BOOLEAN
)
''')

# Insert sample data
pr = [
    ('1', 'Loren', 'loren@example.com', False),   # Singaporean β†’ not PR
    ('2', 'Matt', 'matt@example.com', True),      # Malaysian β†’ PR
    ('3', 'Hilda', 'hilda@example.com', False),   # Singaporean β†’ not PR
    ('4', 'Andy', 'andy@example.com', False),  # Filipino β†’ PR
    ('5', 'Kit', 'kit@example.com', False)     # Vietnamese β†’ PR
]

cursor.executemany('INSERT OR IGNORE INTO pr_details VALUES (?, ?, ?, ?)', pr)

# Commit changes and close
conn.commit()
conn.close()
print("government.db populated with sample customer data.")