Using the Sqlite3 database, you can get a list of column names by querying the table:
Table of contents
Start Sqlite
To do this, first open your terminal and enter Sqlite3 followed by the name of your database file:
Sqlite3 chinook.db
Then type
pragma table_info(<table_name>)
to show all columns in the specified table. The output will show the name of each column, as well as its data type. As an example:
sqlite> PRAGMA table_info(employees);
returns
0|EmployeeId|INTEGER|1||11|LastName|NVARCHAR(20)|1||02|FirstName|NVARCHAR(20)|1||03|Title|NVARCHAR(30)|0||04|ReportsTo|INTEGER|0||05|BirthDate|DATETIME|0||06|HireDate|DATETIME|0||07|Address|NVARCHAR(70)|0||08|City|NVARCHAR(40)|0||09|State|NVARCHAR(40)|0||010|Country|NVARCHAR(40)|0||011|PostalCode|NVARCHAR(10)|0||012|Phone|NVARCHAR(24)|0||013|Fax|NVARCHAR(24)|0||014|Email|NVARCHAR(60)|0||0
Exit Sqlite
To do that simply type exit:
sqlite> exit
or
press Control+D.
