Open Schema/Table/People

From Jonathan Gardner's Tech Wiki
Jump to: navigation, search

Abstract

A person represents a person in real life. See People to see the bigger picture.

Tables

People

CREATE TABLE person (
    person_id INTEGER PRIMARY KEY
    , gender CHAR(1)    -- M/F
    , birth DATETIME    -- When were they born?
    , death DATETIME    -- When did they die?
    , died  BOOLEAN     -- Have they died?
);

Most of the information about people isn't unique, especially their name. They can have more than one name, address, phone number, etc...

Person_Email_Addresses

CREATE TABLE person_email_addresses (
    person_email_address INTEGER PRIMARY KEY
    , person_ID INTEGER FOREIGN KEY (people) NOT NULL
    , email_address_id INTEGER FOREIGN KEY (email_addresses) NOT NULL
    , name VARCHAR
);