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 5 years have passed since last update.

SQLについて

Last updated at Posted at 2019-10-19

こんにちは。今日はSQLの基本についての記事を書いていきたいと思います。

基本の四動作

SELECT

SELECTは取得を意味します。何かのデータを取得したい場合は

SELECT *
FROM テーブル名

で取得できます。「*」はすべてのデータと言う意味です。

INSERT INTO

これは何かの情報を追加したいときに使用します。

INSERT INTO テーブル名
VALUES (  ,  ,  ,  )

UPDATE

UPDATEはもともとあるデータを変更(アップデート)したいときに使います。

UPDATE テーブル名
  SET カラム名 = , カラム名 =  

UPDATEとWHEREは併用可能。

DELETE

DELETEはデータの中から何かを削除したいときに使います。
WHEREで条件指定しないと全部消えてしまうことがあるので注意が必要です。

DELETE FROM テーブル名
WHERE 条件

これらがSQLで使われる基本動作です。
これからSQLで大事だと思った項目をアップデートしていきたいと思います。

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?