Mysql创建表

create table accout(
ACC_ID INT AUTO_INCREMENT PRIMARY KEY,
ACC_FIRST_NAME VARCHAR(20) DEFAULT NULL,
ACC_LAST_NAME VARCHAR(20) DEFAULT NULL,
ACC_EMAIL VARCHAR(40) DEFAULT NULL);

CREATE table `enrol`(
`class_id` varchar (32) not null,
`stu_id` varchar (32) default null,
`accept` varchar (32) default null,
`score` varchar(32) default null,
key `FK_enrol` (`class_id`),
key `FK_Reference_2` (`stu_id`),
constraint `enrol_ibfk_1` foreign key (`class_id`) references `classes` (`id`),
constraint `enrol_ibfk_2` foreign key (`stu_id`) references `stu`(`id`)
);

你可能感兴趣的:(mysql,MySQL)