In this tutorial, we will discuss various ways you can view tables in an SQLite database.
Opening an SQLite Database
Before learning how to show tables in SQLite databases, you need to know how to open a database. For this tutorial, I will use the open-source chinook database available here.
Once you download the SQLite version of the database, open it using the command sqlite3 as:
SQLite Show Tables
To show a table in a database, you need to use the .tables command inside the SQLite shell. For example:
Album Employee InvoiceLine PlaylistTrack
Artist Genre MediaType Track
Customer Invoice Playlist
The above command shows all the tables that exist in that database.
List Tables with Pattern
SQLite also allows you to specify a pattern of the tables you would like to show. For example, to list all tables starting with the letter p:
The final method and most straightforward method to view the tables in a database is to use SQLite Browser. Ensure that you have SQLite browser installed. Open the database and click on the tab, Browse Data.
This quick tutorial has illustrated various ways to list tables in a specific database using the SQLite shell and the SQLite Browser tool.