- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate.py
More file actions
Latest commit
38 lines (22 loc) · 514 Bytes
/
Copy pathupdate.py
File metadata and controls
38 lines (22 loc) · 514 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
28
29
30
31
32
33
34
35
36
37
38
# Clearing the screen
importos
os.system('clear')
# Importing sqlite3 module
importsqlite3
# Establishing a connection and create DB
conn=sqlite3.connect('customer.db')
# Creating a cursor
c=conn.cursor()
# Updating Records
c.execute(""" UPDATE customers SET first_name = "Marty"
WHERE last_name = "Doe"
""")
# Commiting changes made
conn.commit()
# Querying
c.execute("SELECT * FROM customers")
items=c.fetchall()
foriteminitems:
print(item)
# Closing our connection
conn.close()