I thought for a moment that I might be getting this but then my brain got all soggy. I actually think I see what you’re doing. It’s always hard to think differently…
I will ponder your example, and figure out how to change my tables where needed.
Thanks a ton, and I guess that I wont mind if Brazil wins this one, as long as they don’t get nuked for doing so…
Thanks a ton Rudy. I’ll let you know how I make out…
David…
ps. just one more thought… If I do need to migrate my table keys/data, is there a preferred utility/method you have to do that?
since the edition is an auto_increment, all editions are unique
this is also why you don’t need to carry (redundantly) the negative number into the prints table
i did not understand what you meant by this –
select me if
table1 (negative_id and edition_id and print_id) equals table 2 (negative_id and edition_id and print_id).
what are table1 and table2 in that context?
“negative_serial_no can be omitted (it’s a redundant relationship), but if you feel you need it, make it INTEGER to match the PK of the negatives table”.
I could have a negative with number 123 and another with 124.
They each could have an edition number of 1.
If I do not have a negative number in this table, how would I differentiate them?
I want to pass the values of these keys (I thought - combined) , from web page to web page…
How do I do that with combining them and passing them as some variable.? And that’s the part I’m stuck on…
I’ve been working too many nights on this whole project. So as I said when I started this thread, my brain feels like mush. I get that I’m over-complicating things.
If I could possibly ask you to give me an example of a query that pulls this together, I will be extremely grateful…
this is fine except INT(25) should just be INTEGER (the number in brackets is not the number of digits it will hold, but rather the number of digits to display if you use ZEROFILL, and i haven’t seen many apps where a 25-digit number needs to be displayed, especially since INTEGER can hold only up to 10 digits)
you should probably replace all those shoot date and time columns with a single DATETIME column
the PK is correct, but should probably not be UNSIGNED, in order to stay consistent with the other keys (or else they should be UNSIGNED too – many people prefer UNSIGNED for auto_increments because it doubles the number of avaliable numbers from 2 billion to 4 billion)
negative_serial_no can be omitted (it’s a redundant relationship), but if you feel you need it, make it INTEGER to match the PK of the negatives table
edition_serial_no should be INTEGER to match the PK of the editions table
i notice that the negatives table references a collection using a VARCHAR column, you should probably revise that as well
Thanks for responding. I have a key field that grows at each point in the application. (Please let me know if there’s a better way of doing this.
Key 1 = photograph.
Key 2 = photograph + edition (size - there can be different sizes of the same photograph)
Key 3 = photograph + edition + print number (a unique number for a specific prints).