学生餐厅优惠管理系统ER图如何画及数据表如何转换?
- 发布时间:
- 2023-06-14 20:44:10
- 228
摘要:学生餐厅优惠管理系统:主要任务是根据学生在不同的食堂档口购买饭菜等商品的交易情况,以及销售商品的售后服务信息的统计和记录,进行优惠活动。
定制开发或画图联系客服人员
档口表
CREATE TABLE dk (
id int(0) NOT NULL AUTO_INCREMENT,
bh varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
name varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
zmoney decimal(10, 0) NULL DEFAULT NULL,
lb varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
mj varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (id) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- 测试数据
-- ----------------------------
INSERT INTO dk VALUES (1, '001', '瓦香鸡米饭', 80000, '张三', '20');
INSERT INTO dk VALUES (2, '002', '驴蹄子面', 75000, '李四', '18');
INSERT INTO dk VALUES (3, '003', '青春麻辣烫', 60000, '王五', '16');
INSERT INTO dk VALUES (4, '004', '鸡蛋灌饼', 55000, '赵六', '15');
优惠表
CREATE TABLE yh (
id int(0) NOT NULL AUTO_INCREMENT,
bh varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
content varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
ktime varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
jtime varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (id) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- 测试数据
-- ----------------------------
INSERT INTO yh VALUES (1, '001', '瓦香鸡米饭累计消费满一百积分可以享受九五折优惠', '2023——2024学年第一学期开始', '2023——2024学年第二学期结束');
INSERT INTO yh VALUES (2, '002', '累计每获得五十积分可以兑换五元代金券,驴蹄子面代金券可用于众生园超市购物以及自己档口', '2023——2024学年第一学期开始', '2023——2024学年第二学期结束');
INSERT INTO yh VALUES (3, '003', '一次性消费满十二元可以获得一张一元代金券,麻辣烫代金券只能用于自己档口', '2023——2024学年第一学期开始', '2023——2024学年第二学期结束');
INSERT INTO yh VALUES (4, '004', '鸡蛋灌饼累计消费满八十元,购买本档口所有产品均减一元', '2023——2024学年第一学期开始', '2023——2024学年第二学期结束');
学生表
CREATE TABLE student (
number varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
name varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
phone varchar(11) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- 测试数据
-- ----------------------------
INSERT INTO student VALUES ('2021151513', '张三', '16634045578');
INSERT INTO student VALUES ('2021151519', '李四', '15835603866');
INSERT INTO student VALUES ('2021151527', '王五, '15935759166');
INSERT INTO student VALUES ('2021151546', '赵六, '16636127530');
会员表
CREATE TABLE hy (
id varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
times date NULL DEFAULT NULL,
sid varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- 测试数据
-- ----------------------------
INSERT INTO hy VALUES ('202300001', '2023-10-01', '银卡');
INSERT INTO hy VALUES ('202300002', '2023-10-10', '铜卡');
INSERT INTO hy VALUES ('202300003', '2023-11-11', '金卡');
INSERT INTO hy VALUES ('202300004', '2024-03-03', '金卡');