Emphasis indcates primary key.

Books
element type
id unique_key
title varchar
author People.id
publisher Publishers.id
publish_date timedate
isbn varchar
value money

People
element type
id unique_key
prefix Prefixes.id
f_name varchar
m_name varchar
l_name varchar
suffix Suffixes.id

Prefixes
element type
id unique_key
prefix varchar

Suffixes
element type
id unique_key
suffix varchar

Publishers
element type
id unique_key
name varchar

Transactions
element type
id unique_key
book Books.id
person People.id
date_out timedate
date_due timedate
date_in timedate
fee money

BookReviews
element type
id unique_key
book Books.id
reviewer People.id
review text

Phones
element type
id unique_key
country_code varchar
city_code varchar
line varchar

Addresses
element type
id unique_key
street varchar
city varchar
country varchar
zip varchar

Emails
element type
id unique_key
email varchar

People_Addresses
element type
person People.id
address Addresses.id
type AddressTypes.id

Publishers_Addresses
element type
publisher Publishers.id
address Addresses.id

People_Phones
element type
person People.id
phone_no Phones.id
type PhoneTypes.id

Publishers_Phones
element type
publisher Publishers.id
phone_no Phones.id

People_Emails
element type
person People.id
email Emails.id
type EmailTypes.id

PhoneTypes
element type
id unique_key
type varchar

AddressTypes
element type
id unique_key
type varchar

EmailTypes
element type
id unique_key
type varchar

Offices
element type
id unique_key
title varchar

Officers
element type
id unique_key
office Offices.id
person People.id
date_in timedate
date_out timedate

Tokens
element type
id unique_key
person People.id
type TokenTypes.id
value varchar

TokenTypes
element type
id unique_key
type varchar


Names

Names are sacred. They shall never be modified. I do not decree what your name is. You do. You tell me, and I make the rules bend to your will. This is why the Names portion of this database is undergoing some upheaval. Some people will say that it is too complicated, but I have two design goals:

This is a tall order, I know. This is what I want, and I will not settle for less.

I decided to compromise. Though the below schema would work, it would turn into a SELECT nightmare. I don't really want to do that.

People
element type
id unique_key
prefix Prefixes.id
name Names.id
suffix Suffixes.id
nickname Names.id

Names
element type
id unique_key
order integer
type
  • first
  • last
  • other
name varchar
initial char

Prefixes
element type
id unique_key
prefix varchar

Suffixes
element type
id unique_key
suffix varchar