일대일, 일대다, 다대다 모델 데이터 생성 sql 문장

3058 단어 Django
원문 연결: Django 모형의 일대일, 일대다, 다대다 조작에 대한 상세한 설명
INSERT INTO `app1_class` VALUES ('1', '1609B', '2018-12-05');
INSERT INTO `app1_class` VALUES ('2', '1609A', '2018-12-11');
INSERT INTO `app1_class` VALUES ('3', '1609C', '2018-12-11');
INSERT INTO `app1_class` VALUES ('4', '1609D', '2018-12-11');
INSERT INTO `app1_class` VALUES ('5', '1609E', '2018-12-11');

INSERT INTO `app1_teacher` VALUES ('1', 'zhoulaoshi');
INSERT INTO `app1_teacher` VALUES ('2', 'wanglaoshi');
INSERT INTO `app1_teacher` VALUES ('3', 'tianlaoshi');
INSERT INTO `app1_teacher` VALUES ('4', 'wulaoshi');
INSERT INTO `app1_teacher` VALUES ('5', 'lilaoshi');


INSERT INTO `app1_teacher_cid` VALUES ('1', '1', '2');
INSERT INTO `app1_teacher_cid` VALUES ('2', '1', '3');
INSERT INTO `app1_teacher_cid` VALUES ('3', '2', '1');
INSERT INTO `app1_teacher_cid` VALUES ('4', '2', '3');
INSERT INTO `app1_teacher_cid` VALUES ('5', '3', '4');
INSERT INTO `app1_teacher_cid` VALUES ('6', '4', '1');
INSERT INTO `app1_teacher_cid` VALUES ('7', '4', '5');
INSERT INTO `app1_teacher_cid` VALUES ('8', '5', '3');
INSERT INTO `app1_teacher_cid` VALUES ('9', '5', '4');


INSERT INTO `app1_studentdetail` VALUES ('1', '178', '[email protected]', '11111');
INSERT INTO `app1_studentdetail` VALUES ('2', '172', '[email protected]', '222');
INSERT INTO `app1_studentdetail` VALUES ('3', '168', '[email protected]', '333');
INSERT INTO `app1_studentdetail` VALUES ('4', '158', '[email protected]', '444');
INSERT INTO `app1_studentdetail` VALUES ('5', '155', '[email protected]', '555');
INSERT INTO `app1_studentdetail` VALUES ('6', '190', '[email protected]', '666');
INSERT INTO `app1_studentdetail` VALUES ('7', '111', '[email protected]', '777');
INSERT INTO `app1_studentdetail` VALUES ('8', '158', '[email protected]', '888');

INSERT INTO `app1_student` VALUES ('1', 'gaofeifie', '1', '1');
INSERT INTO `app1_student` VALUES ('2', 'zgz', '2', '2');
INSERT INTO `app1_student` VALUES ('3', 'dh', '3', '3');
INSERT INTO `app1_student` VALUES ('4', 'gaohan', '3', '4');
INSERT INTO `app1_student` VALUES ('5', 'jzl', '4', '5');
INSERT INTO `app1_student` VALUES ('6', 'dl', '1', '6');
INSERT INTO `app1_student` VALUES ('7', 'zyf', '1', '7');






좋은 웹페이지 즐겨찾기