![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
On 2011-03-19 00:11, Captain Paralytic wrote: [...] My idea was that, if using check constraints, one would only need a single awards table, the allowance of multiple awards being done from an award properties table. If using separate tables, it can be done without the need for the check constraints. Paul, I'm not sure that I follow. Let's see if I can get this right, (let's skip the temporal aspect for simplicity) create table award_properties ( award_id, max_occurrences ) create table award_winners ( award_id, ssn ) correct so far? |
#12
| |||
| |||
|
|
On Mar 19, 7:17 am, Lennart Jonsson <erik.lennart.jons... (AT) gmail (DOT) com wrote: On 2011-03-19 00:11, Captain Paralytic wrote: [...] My idea was that, if using check constraints, one would only need a single awards table, the allowance of multiple awards being done from an award properties table. If using separate tables, it can be done without the need for the check constraints. Paul, I'm not sure that I follow. Let's see if I can get this right, (let's skip the temporal aspect for simplicity) create table award_properties ( award_id, max_occurrences ) create table award_winners ( award_id, ssn ) correct so far? spot on |
#13
| ||||
| ||||
|
|
On 03/19/2011 11:12 PM, Captain Paralytic wrote: On Mar 19, 7:17 am, Lennart Jonsson <erik.lennart.jons... (AT) gmail (DOT) com wrote: On 2011-03-19 00:11, Captain Paralytic wrote: [...] My idea was that, if using check constraints, one would only need a single awards table, the allowance of multiple awards being done from an award properties table. If using separate tables, it can be done without the need for the check constraints. Paul, I'm not sure that I follow. Let's see if I can get this right, (let's skip the temporal aspect for simplicity) create table award_properties ( award_id, max_occurrences ) create table award_winners ( award_id, ssn ) correct so far? spot on Sorry about late answer, had a *minor* incident with my computer. The rules we like to enforce is: When you say "The rules _WE_ like to enforce", are you working with |
|
R1: award with max_occurrences = 1 can only be given once, regardless * * of ssn. I'm intrigued, what does "ssn" stand for? |
|
R2: award with max_occurrences > 1 can be given more than once but * * only one time to each ssn. R3: The same ssn can have multiple awards as long as all of them * * have max_occurrences > 1 I'm not quite clear on these rules. The OP said: "For each entry, it |
|
I don't see how these rules can be implemented given the two tables above. Can you elaborate on this? /Lennart |
![]() |
| Thread Tools | |
| Display Modes | |
| |