「SQLite」データベースとテーブルを作成する方法

書式
sqlite3 データベース名

操作方法
1.データベース名を作成

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
C:\sqlite\sqlite3>sqlite3 arkgame.sqlite3
SQLite version 3.36.0 2021-06-18 18:36:39
Enter ".help" for usage hints.
sqlite>
C:\sqlite\sqlite3>sqlite3 arkgame.sqlite3 SQLite version 3.36.0 2021-06-18 18:36:39 Enter ".help" for usage hints. sqlite>
C:\sqlite\sqlite3>sqlite3 arkgame.sqlite3
SQLite version 3.36.0 2021-06-18 18:36:39
Enter ".help" for usage hints.
sqlite>

2.テーブルを作成
構文 crate table テーブル名(カラム1,カラム2,xx)

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
sqlite> create table usertbl(userid,name,addr);
sqlite> create table usertbl(userid,name,addr);
sqlite> create table usertbl(userid,name,addr);

3.データベースとの接続を終了

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
sqlite> .exit
C:\sqlite\sqlite3>
sqlite> .exit C:\sqlite\sqlite3>
sqlite> .exit
C:\sqlite\sqlite3>

 

SQLite

Posted by arkgame