sql - One to One relationship many tables -
i new using databases , trying design new database think need one-to-one relationship spread across many tables. to demonstrate design, let's building schedule database example. start creating table person one-to-many relationship create table person ( person_id serial not null, name varchar, primary key (person_id) ); next, create table of events contains many portion of person relationship create table events ( event_id serial not null, type varchar, name varchar, person_id integer, time timestamp without time zone, primary key (event_id), foreign key(person_id) references person (person_id) ); now lets have 2 different types of events have different information them, meal , homework create table meals ( event_id integer not null, food varchar, utensils varchar, primary key (event_id), foreign key(event_id) references events (event_id) ); create table homework ( event_id integer not null, su...