sqlite3数据库里表的信息存储在了一个名为sqlite_master的表中
因此可以通过这条语句来查看数据库中所有表的名称
SELECT name FROM sqlite_master WHERE type='table';
下面是Python的用法
1
2
3
4
con = sqlite3.connect('database.db')
cursor = con.cursor()
cursor.execute("SELECT name FROM sqlite_master WHERE type='table';")
print(cursor.fetchall())