suwesh commited on
Commit
c560f8b
·
verified ·
1 Parent(s): db8e834

Create db_setup.py

Browse files
Files changed (1) hide show
  1. db_setup.py +29 -0
db_setup.py ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import sqlite3
2
+ def setup_database():
3
+ conn = sqlite3.connect('sfdc_la.db')
4
+ cursor = conn.cursor()
5
+ cursor.execute('''
6
+ CREATE TABLE IF NOT EXISTS sfdc_la (
7
+ LAid TEXT PRIMARY KEY,
8
+ Amount REAL,
9
+ ROI REAL,
10
+ Stage VARCHAR
11
+ )
12
+ ''')
13
+ #inserting data into table
14
+ loan_data = [
15
+ ('LA00001', 10000, 12, 5.5, 'Customer Onboarding'),
16
+ ('LA00002', 15000, 24, 6.0, 'Credit Review'),
17
+ ('LA00003', 20000, 36, 6.5, 'Loan Disbursal'),
18
+ ('LA23455', 25000, 48, 7.0, 'OTC Clearance'),
19
+ ('LA00005', 30000, 60, 7.5, 'Customer Onboarding')
20
+ ]
21
+ cursor.executemany('''
22
+ INSERT INTO sfdc_la (LAid, Amount, Tenure, ROI, Stage)
23
+ VALUES (?, ?, ?, ?, ?)
24
+ ''', loan_data)
25
+ conn.commit()
26
+ conn.close()
27
+
28
+ if __name__ == "__main__":
29
+ setup_database()