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?

SQLで既存のテーブルに項目(列)を追加する方法

Posted at

SQLで既存のテーブルに項目(列)を追加するには「ALTER TABLE」を使います

例1)
 BASEBALLテーブルにstudium列を追加(文字列、NULL不可)

ALTER TABLE BASEBALL
ADD studium VARCHAR(255) NOT NULL;

例2)
 BASEBALLテーブルにrank列を追加(整数)

ALTER TABLE BASEBALL
ADD rank INT;

例3)
 BASEBALLテーブルに複数列を追加

ALTER TABLE BASEBALL
ADD (
    studium VARCHAR(255) NOT NULL,
    rank INT
    );
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?