SQLite CLI and Shell Cheatsheet/Show schema for one table

Print the CREATE statement for a specific object.

Section: Open and inspect databases

Show schema for one table

text
text
.schema users
Explanation

Limits output to matching objects, which is easier to read in larger databases.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Open and inspect databases
List tables
Show table names in the current database.
OpenIn sheettextsame section
Show full schema
Print CREATE statements for the whole database.
OpenIn sheettextsame section
Open a database file
Start the sqlite3 shell with a file-backed database.
OpenIn sheetbashsame section
Open an in-memory database
Start a temporary database that lives only for the session.
OpenIn sheetbashsame section
List attached databases
Show the main database and any attached files.
OpenIn sheettextsame section
Show schema plus sqlite_stat tables
Include internal objects useful for advanced debugging.
OpenIn sheettextsame section