Help us understand the problem. What is going on with this article?

よく使うSQL文 チートシート | SQLite編

インストール

brew install sqlite3

データベースの作成と接続

sqlite3 データベースファイル名
sqlite3 test.db
sqlite3 test.sqlite3

テーブルを作成する

CREATE TABLE テーブル名(カラム名1 データ型, カラム名2 データ型);
create table personal2(id integer, title text);

テーブルのデータを取得

select * from テーブル名;

テーブルにカラムを追加する

ALTER TABLE テーブル名 ADD COLUMN カラム名[ データ型];

テーブルを削除

DROP TABLE テーブル名;

テーブルにデータを追加する

INSERT INTO テーブル名 VALUES(値1, 値2);

テーブルのデータを更新

UPDATE テーブル名 SET カラム名1 = 値1, カラム名2 = 値2 WHERE 条件式;

テーブルのデータを削除

DELETE FROM テーブル名 WHERE 条件式;

参考

https://www.dbonline.jp/sqlite/insert/index6.html

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした