Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I'm designing a database for a new project and I'm looking for some feedback on the design before I start to implement/test. It basically consists of users, events, user profiles and a messaging system.

Certain users can create events which others can view, this is determined from the userType table. I'm unsure if I should be storing the lost password columns in the users table, would there any benefit for using a separate table for this?

(I'm not to sure if my relationships are setup correctly)

Database Design

Full size

Appreciate any feedback given =)

Thanks !

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Having the users and lost passwords in the same table implies a 1-1 (or 1-0/1) relationship; 1 user has 1 lost password (or none, if the column is nullable).

If that's the cardinality of the relationship, having them on the same table is correct. The school of thought that refuses nulls (which depending on the day, I adhere to), says that if the relationship is 1-0/1, you should:

users
  usersID primary key

lostPasswords
  usersID primary key references users(users_id)
  -- lost password columns here, non-nullable

The relationships look fine, however, I would suggest you use a diagramming tool which shows which are the columns referenced. Surprisingly, I've only found SchemaSpy doing this: http://schemaspy.sourceforge.net/sample/diagrams/summary/relationships.real.compact.png

share|improve this answer
    
Thanks I think I will use your idea of a separate lostPassword table. Thanks for the link to SchemaSpy! –  Elliott Dec 12 '11 at 14:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.