Database structuring issue in SQL Server; Contests and Registrants -


Preface:
I am creating some tables in SQL Server through which Can be accessed from the MVC application to the Linux-to-Units, although the fact that this SQL Server is probably only a relevant part. I am not very experienced with the database, and during my implementation there have been some issues that raised some red flags for me.

Business logic:
Still, I'm going out for some help where I have gone wrong and hopefully, to identify some improvements. The essence of business logic is that I have competitions and registrars. A registrar can register only once for each competition implemented by email address matching. They can register for many competitions, but it logically logs out to register differently as it is a business requirement that the name / email address combo for each registration should be kept aside ... i.e. There is a new pair for the competition. Generally I will use the cross reference table to link registrants to the competitions ... But given the above obstacle, a xref table can not save me anything which I can see.

Data logic:
Contestants need to know some information about themselves such as title, start date, expiration date, etc. and the winners of the competition, which are definitely Is zero than

Registrars are a name, email address, and in which competition they are registered

Tables:
I do not know what my table structure is here It is best to contact the type and it is very important to post MSSQL questions, please forgive me if you do not like your way down ...

 Competitions {ID [ Int] [non-null] [primary key] winner [int] [n Eligible] [Foreign key in the Registry table] ... Some data columns that should not be relevant, title, description, date, etc. ...} Registrar {id [int] [non-null] [primary key] competition [ Entry] [Non-Null] [Foreign Key] in the Competitive Table [Name (Newcomer (80)] [Non-Null] Email [Navbharva (80)] [Non-Null]}  

Concerns More Issues:
When I loaded this schema into the unit framework, I came to know that one The circular reference. Points of a contest (probably) that tells about that competition. It seems that this is going to be a nuisance, if I try to delete the record (although this will probably never happen). Is this a potential failure, and if so, how would I want to avoid it? After registration, I did not wish to be a 'winner' flag, because I want to end with a column which was almost completely faucet ... seems useless.

Since competing with the unique business obligation on registration, one-to-many, one-to-many, Is it acceptable to leave the cross reference table? Or is this bad behavior? (I know that this will work in my scenario ... but it can still be a bad form ...) Generally, it seems that my solution leaves something to be desired, but possibly (perhaps) issues There is no experience to look at Other suggestions are eagerly asked.

Close:
I know these questions are unclear ... and I'm sorry.

Thanks,
Dave Div >

At first crack, you design the database with the Qualified database, i.e. on the issues of client or midware Regardless of Person ID Title Contest ID Name Contest Transcript subjective foreign key reference person Competitive Foreign Key Reference Contest (ID) Primary Primary Key: (person, competition)

or you can:

ContestRegistrations

  id [primary key auto increment] Personal foreign key reference person (ID) Contestant foreign key reference Coonte   

The winner is a different problem:

  The competition is a separate problem on ST (ID) optional unique key (i.e., unique composite index) (personal, competitive). . Winner is the foreign key reference person (id)   

But it opens the possibility that no one could enter the winner who was not registered, the winner should be a registrant can be applied procedurally, Undoubtedly. It is also possible to apply it to the declaratory contextual integrity in the DB structure:

  competition. . ContestRegistrants (subjective, competition)   

Your approach will not work here because it is only to see that the winner is registered for some competition, Not necessarily competition in the competition.

Comments