- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdrop_table.py
More file actions
Latest commit
33 lines (19 loc) · 455 Bytes
/
Copy pathdrop_table.py
File metadata and controls
33 lines (19 loc) · 455 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
# 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()
# Drop table
c.execute("DROP TABLE customers")
# Commiting changes made
conn.commit()
c.execute("SELECT rowid, * FROM customers LIMIT 2 ")
items=c.fetchall()
foriteminitems:
print(item)
# Closing our connection
conn.close()