- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDataBase.py
More file actions
Latest commit
27 lines (16 loc) · 493 Bytes
/
Copy pathDataBase.py
File metadata and controls
27 lines (16 loc) · 493 Bytes
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
importsqlite3
# database practice with python.
connection=sqlite3.connect("users.db")
cursor=connection.cursor()
cursor.execute("""DROP TABLE user""")
command="""
CREATE TABLE user (
uname VARCHAR(15),
walletAmount INTEGER,
joining DATE);"""
cursor.execute(command)
command="""INSERT INTO user (uname, walletAmount, joining)
VALUES ("Test User", 100, 2018-07-12);"""
cursor.execute(command)
connection.commit()
connection.close()