数据库的字段约束
实战:
CREATE TABLE t_teacher ( id INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, name VARCHAR(20) NOT NULL, tel CHAR(11) NOT NULL UNIQUE, married BOOLEAN NOT NULL DEFAULT FALSE );
CREATE TABLE t_teacher ( id INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, name VARCHAR(20) NOT NULL, tel CHAR(11) NOT NULL UNIQUE, married BOOLEAN NOT NULL DEFAULT FALSE );