0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

INSERT文

INSERTCRUDにおけるCreateにあたるもの

基本

使用方法

INSERT INTO table_name (column1, column2, column3,...) VALUES (value1, value2, value3,...);

解説

column1に入れる値をvalue1に記述する
column2に入れる値をvalue2に記述する
column3に入れる値をvalue3に記述する

user表

name age gender address
varchar int varchar varchar
INSERT INTO user (name, age, gende) VALUES ('john', 23, 'male');

文字列として扱う(varchar型に代入する)場合シングルクォーテーションで囲む

INSERT INTO user VALUES ('john', 23, 'male', 'Tokyo');

テーブル内にあるすべてのカラムに入れる場合はテーブルのカラム名を省略できる

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?