To show (display) the list of tables created in a database the following program can be used.
con = sqlite3.connect('Academy.db')
cursor = con.cursor()
cursor.execute("SELECT name FROM sqlite_master WHERE type='table';")
[('Student',), ('Appointment',), ('Person',)]
The above program (Example 15.3-1) display the names of all tables created in ‘Academy. db’ database. The master table holds the key information about your database tables and it is called sqlite_master
So far, you have been using the Structured Query Language in Python scripts. This chapter has covered many of the basic SQL commands. Almost all sql commands can be executed by Python SQLite module. You can even try the other commands discussed in the SQL chapter.