sqlite3 查看表結構


如果想列出該數據庫中的所有表,可:

.tables

如果想查看這些表的結構:

select * from sqlite_master where type="table";

默認情況下,不會出現紅框中的表頭,需要之前設置,命令為:

.header on

如果只想查看具體一張表的表結構,比如查看emperors表,命令為:

select * from sqlite_master where type="table" and name="emperors";

另外,也可以這樣:

sqlite> .schema emperors 
CREATE TABLE emperors( id integer primary key autoincrement, name text,dynasty text,start_year text);


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM