一、每个子类对应一个数据表(Table per concrete class)
学生表
create table `sample`.`student`(
`id` bigint not null auto_increment,
`name` varchar(20) default "" not null,
`score` float,
primary key (`id`)
);
create unique index `PRIMARY` on `sample`.`student`(`id`);
教师表
create table `sample`.`teacher`(
`id` bigint not null auto_increment,
`name` varchar(20) default "" not null,
`salary` float(6,2),
primary key (`id`)
);
create unique index `PRIMARY` on `sample`.`teacher`(`id`);
Tags: 继承 joined-subclass