Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
テーブルの作成について質問があります。
列sssを持つテーブルxxxを作成したいとしましょう。とはどういう意味NOT NULL DEFAULT '0'ですか?
NOT NULL DEFAULT '0'
別の列がDEFAULT NULL
DEFAULT NULL
CREATE TABLE `xxx` ( `sss` smallint(6) NOT NULL DEFAULT '0', `mmm` date DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8
いつ使うのEngine?
Engine
ありがとう
NOT NULL は、列に値が必要であることを意味します。
DEFAULT '0' は、特に指定しない限り、列のデフォルト値が '0' であることを意味します。