Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can one see the structure of a table in SQLite? [duplicate]

Tags:

sqlite

How can I see the structure of table in SQLite as desc was in Oracle?

like image 464
Ali Avatar asked Jan 11 '11 06:01

Ali


People also ask

How can I see the structure of a table in SQLite?

If you are running the sqlite3 command-line access program you can type ". tables" to get a list of all tables. Or you can type ". schema" to see the complete database schema including all tables and indices.

How do I view the contents of a SQLite database?

Open a command prompt (cmd.exe) and 'cd' to the folder location of the SQL_SAFI. sqlite database file. run the command 'sqlite3' This should open the SQLite shell and present a screen similar to that below.

What is schema in SQLite?

Every SQLite database contains a single "schema table" that stores the schema for that database. The schema for a database is a description of all of the other tables, indexes, triggers, and views that are contained within the database.


1 Answers

PRAGMA table_info(table_name); 

This will work for both: command-line and when executed against a connected database.

A link for more details and example. thanks SQLite Pragma Command

like image 134
AnonGeek Avatar answered Oct 11 '22 05:10

AnonGeek