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.

【MySQL】テーブル作成

Posted at

参考にするテーブルの構造を見る

CREATE文を作る際に、ベースにしたいテーブルのCREATE文をチェックしたい際などに確認する。

SQL
SHOW CREATE TABLE model_tbl;

テーブルを作成する

SQL
CREATE TABLE `hoge_tbl` (
 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
 `name` mediumtext NOT NULL,
 `section_ids` varchar(255) NOT NULL,
 `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
 `updated_ad` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
 PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8
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?