Re: Three tables or one?
Posted by: Richard Ostler
Date: March 14, 2007 03:01AM

Hi Kathy,

I think each option is fine but I would probably go for your three table option because:

1. Telephone, fax and pager may represent different entities - later you may want to add another field to telephone, but not to fax and pager.

2. Easier SQL. If you want the list of telephone numbers only, you don't need to add a where clause filtering on telephone number. You would if everything is in the one table.

3. You can have the best of both worlds by unioning the three tables to create a contacts view to represent the one table option. e.g,
create view contacts as
select id, number, 'telephone' as type from telephones
union 
select id, number, 'fax' as type from faxes
union 
select id, number, 'pager' as type from pager

Richard

Options: ReplyQuote


Subject
Written By
Posted
March 13, 2007 03:55PM
Re: Three tables or one?
March 14, 2007 03:01AM
March 14, 2007 09:20AM
March 14, 2007 09:29AM
March 16, 2007 08:07AM
March 25, 2007 03:38PM
March 26, 2007 04:40AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.