Re: same sequence as primary key in more than one table

From: Shakespeare <>
Date: Mon, 15 Jun 2009 13:02:18 +0200
Message-ID: <4a362a40$0$193$>

student4life schreef:
> Hello,
> For example, I have 'sellers' and 'buyers' both need to authenticate
> from a database table 'users' with sequence as primary key which is
> also as primary key in tables 'sellers' and 'buyers' (both have one-to-
> one relationship with 'users') but I am not sure whether it's good
> practice to have sequence number jumping alternatively between tables.
> Could someone inform me what the best practice/design is under the
> scenario? TIA

As long as sequences and there values don't have a significant meaning, there is no problem with using the same sequence for different tables. It's a matter of taste and standards. Some standards require a separate sequence for each table, some standards don't.

I wonder though: is the primary key in 'sellers' the same value as the primary key in 'users', so if a seller has, let's say, 1676 as primary key, is the primary key value in 'users' 1676 as well?

Shakespeare Received on Mon Jun 15 2009 - 06:02:18 CDT

Original text of this message