primary key to primary key

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
GeXus
Forum Regular
Posts: 631
Joined: Sat Mar 11, 2006 8:59 am

primary key to primary key

Post by GeXus »

Is it bad design to have the same primary key used in multiple tables?

For example, I have users and images tables... user_id is the primary for users, and I was going to have user_id be the primary for images as well, as the images are related to a specific user...
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

it's done all the time.
GeXus
Forum Regular
Posts: 631
Joined: Sat Mar 11, 2006 8:59 am

Post by GeXus »

Nice, thanks!
Post Reply