sql

DROP TABLE IF EXISTS emp; CREATE TABLE emp ( idint(11) NOT NULL COMMENT ‘员工编号‘, namevarchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT ‘员工姓名‘, dept_idint(11) NULL DEFAULT NULL COMMENT ‘部门编号‘, leaderint(11) NULL DEFAULT NULL COMMENT ‘直属领导id‘, is_enable int(11) NULL DEFAULT NULL COMMENT ‘是否在职 1在职 0离职‘, PRIMARY KEY (id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;

INSERT INTO emp VALUES (1, ‘张三丰‘, 1, 0, 1);
INSERT INTO emp VALUES (2, ‘张无忌‘, 1, 1, 1);
INSERT INTO emp VALUES (3, ‘小龙女‘, 1, 1, 1);
INSERT INTO emp VALUES (4, ‘小白菜‘, 1, 3, 1);
INSERT INTO emp VALUES (5, ‘韦小宝‘, 2, 0, 1);
INSERT INTO emp VALUES (6, ‘令狐冲‘, 2, 0, 1);
INSERT INTO emp VALUES (7, ‘东方不败‘, 0, 8, 1);
INSERT INTO emp VALUES (8, ‘任我行‘, 3, 0, 1);
INSERT INTO emp VALUES (9, ‘李寻欢‘, 0, 8, 1);`

sql

上一篇:orale之命令行创建&删除数据库


下一篇:SQL练习:轻轻松松,1(中等)+2(较难)