Spaces:
Paused
Paused
import sqlite3 | |
def setup_database(): | |
conn = sqlite3.connect('sfdc_la.db') | |
cursor = conn.cursor() | |
cursor.execute(''' | |
CREATE TABLE IF NOT EXISTS sfdc_la ( | |
LAid TEXT PRIMARY KEY, | |
Amount REAL, | |
Tenure INTEGER, | |
ROI REAL, | |
Stage VARCHAR | |
) | |
''') | |
#inserting data into table | |
loan_data = [ | |
('LA00001', 10000, 12, 5.5, 'Customer Onboarding'), | |
('LA00002', 15000, 24, 6.0, 'Credit Review'), | |
('LA00003', 20000, 36, 6.5, 'Loan Disbursal'), | |
('LA23455', 25000, 48, 7.0, 'OTC Clearance'), | |
('LA00005', 30000, 60, 7.5, 'Customer Onboarding') | |
] | |
cursor.executemany(''' | |
INSERT INTO sfdc_la (LAid, Amount, Tenure, ROI, Stage) | |
VALUES (?, ?, ?, ?, ?) | |
''', loan_data) | |
conn.commit() | |
conn.close() | |
if __name__ == "__main__": | |
setup_database() | |