【发布时间】:2016-06-19 13:01:38
【问题描述】:
假设我有桌子:
create table people (
human_id bigint auto_increment primary key,
birthday datetime );
create table students (
id bigint auto_increment primary key,
human_id bigint unique key not null,
group_id bigint not null );
create table teachers (
id bigint auto_increment primary key,
human_id bigint unique key not null,
academic_degree varchar(20) );
create table library_access (
access_id bigint auto_increment primary key,
human_id bigint not null,
accessed_on datetime );
现在我想在惯用的方式。
我如何形成查询(如果已经部署了此类数据库)以及解决该问题的更好和更惯用的方法(如果到目前为止尚未部署)。
MariaDB 5.5,Go 访问的数据库,仅此而已。
提前致谢。
【问题讨论】:
-
样本数据和预期结果会有所帮助。