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 working on a "Event Management System" Online Software Project where the system requires the following:

  1. Viewers can sign up for their user account
  2. Events can be created by the admin from the admin panel
  3. Each event requires that the student has a set of attributes
  4. The required attribute for an event may or may not exist in the user's details table
  5. When the user wants to apply for participation in an event, the system will prompt for the missing attributes
  6. Once the user fills in the missing attributes, the system will accept an application for the event, from the user.

To solve this one I created the following tables.

  • users (user_id [PK], username, password, user_level)
  • userdetails (user_id [FK], name, address, attr1, attr2, attr3, ... , attrN)
  • event (event_id [PK], event_start, event_end, event_title)
  • eventdetails (event_id [FK], ... )

How do I relate the eventdetails and the userdetails, such that the eventdetails

requires a tuple of n attributes from the userdetails table?

I was thinking something like:

The system will add n colums to the userdetails field as soon as a new event is

created by the admin.

Am i thinking in the proper way?

share|improve this question
    
The terminology is not clear to me. Why would you add columns to the userdetails table? If you described a scenario what should happen when, it would help a lot. –  dezso Jul 19 '13 at 10:38
    
An admin can create an event, for which an user can reply. A particular event can require a specific set of attributes of the applicant. These required attributes can be present in the userdetails table. (Or some of the required attributes can be present.) –  Kryolyte Jul 19 '13 at 10:43
    
what are some examples of user attributes? –  Neil McGuigan Jul 19 '13 at 19:29
add comment

1 Answer

I think you want a lookup table that shows the requirements for a particular event. In this case, generally I would also have attr1-3 in a separate table called 'Attribute' and a user_attribute table to assign attributes to a particular user_detail record. Then, you could assign a particular event to require n attributes through the lookup table-

event_attribute (event_attribute_id [PK], event_id [FK], attribute_id [FK],...).

share|improve this answer
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.