Z
Z
zyusifov112020-12-24 15:32:44
Python
zyusifov11, 2020-12-24 15:32:44

How to get all tables from sqlite3 database?

There is a database base how to display all the tables that are there?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
Yuriy Vorobyov, 2020-12-24
@zyusifov11

con = sqlite3.connect("data.db")
cursor = con.cursor()

cursor.execute("SELECT name FROM sqlite_master WHERE type='table';")
print(cursor.fetchall())

V
Vladimir Korotenko, 2020-12-24
@firedragon

show tables;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question