Re: Database normalization - Mailing list pgsql-sql

From Sebastian Ritter
Subject Re: Database normalization
Date
Msg-id 99b656cb0708280447x4eb7c45axec01c8d0ebc6c82d@mail.gmail.com
Whole thread Raw
Responses Re: Database normalization  ("Asko Oja" <ascoja@gmail.com>)
Re: Database normalization  (Andrew Sullivan <ajs@crankycanuck.ca>)
Re: Database normalization  (Erik Jones <erik@myemma.com>)
List pgsql-sql
Hello,

I have a fairly basic question about database design where im not sure which approach is considered correct.

I have two different entities: Clients and Services. Both allow users to add progressive updates about the two entities.

The update/message format is exactly the same for both. Should I make two different tables:

  client_updates and service_updates
  or
  one table with extra columns : is_client, client_id, service_id, where either client_id or service_id would be null depending on the is_client boolean?

The major problem is simply relating the foreign key in the updates table back to the correct entity, client or service.

Regards,
Sebastian


pgsql-sql by date:

Previous
From: hubert depesz lubaczewski
Date:
Subject: Re: fetch first rows of grouped data
Next
From: Michael Glaesemann
Date:
Subject: Re: fetch first rows of grouped data