--------<br />Andy Zhu<br />scjp 1.4<br />scjd 1.4<br />SAS Certified Programmer 9.0
--------<br />Andy Zhu<br />scjp 1.4<br />scjd 1.4<br />SAS Certified Programmer 9.0
SCJD 1.4<br />SCJP 1.4<br />-----------------------------------<br />"With regard to excellence, it is not enough to know, but we must try to have and use it.<br />" Aristotle
--------<br />Andy Zhu<br />scjp 1.4<br />scjd 1.4<br />SAS Certified Programmer 9.0
SCJD 1.4<br />SCJP 1.4<br />-----------------------------------<br />"With regard to excellence, it is not enough to know, but we must try to have and use it.<br />" Aristotle
Yes!Finally, you must have a PK. You can choose any field or combination of fields to be your PK as long as you can justify it in your choice document.
“Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.” - Rich Cook
--------<br />Andy Zhu<br />scjp 1.4<br />scjd 1.4<br />SAS Certified Programmer 9.0
Anton Golovin (anton.golovin@gmail.com) SCJP, SCJD, SCBCD, SCWCD, OCEJWSD, SCEA/OCMJEA [JEE certs from Sun/Oracle]
--------<br />Andy Zhu<br />scjp 1.4<br />scjd 1.4<br />SAS Certified Programmer 9.0
Originally posted by Hanna Habashy:
Mark,
I don't know the specification requirments of URLybird. I have a question: Does the database allow for duplicate records? If yes, then you are right, and if no, then you must find a PK. If one cannot find a PK, then he can use a combination of all fields to be a PK.
IMHO, If the databse allow for duplicate records, then there is no needs for PK, and if the database doesn't allow for duplicate records then how can you catch it when someone tries to add the record more than once, or update a record to be exact as already stored record...?
Anton Golovin (anton.golovin@gmail.com) SCJP, SCJD, SCBCD, SCWCD, OCEJWSD, SCEA/OCMJEA [JEE certs from Sun/Oracle]
Anton, you are correct in that area, in that URLybird doesn't really have a PK, whereas B&S does.
SCJD 1.4<br />SCJP 1.4<br />-----------------------------------<br />"With regard to excellence, it is not enough to know, but we must try to have and use it.<br />" Aristotle
Yep, the assignment is about hotel rooms, which can be as many of a kind as the rooms in a hotel... So, no PK
SCJD 1.4<br />SCJP 1.4<br />-----------------------------------<br />"With regard to excellence, it is not enough to know, but we must try to have and use it.<br />" Aristotle
SCJP 1.4, SCJD
SCJD 1.4<br />SCJP 1.4<br />-----------------------------------<br />"With regard to excellence, it is not enough to know, but we must try to have and use it.<br />" Aristotle
Normally I would argue that it is better design to be able to update any attribute. In this project, however, it could be argued either way. Whatever you decide, just be sure to document it in your design decisions document.1. some said PK is immutable in this db-specific project, then I should verify the old pk with the new pk of that recNo only.
2. However, in general, pk is updatable as long as the new values of pk doesn't have duplicates in the db. so I should check it against all the valid (means not deleted) records.
In addition, we have this db-specific project, will we only allow update owner or other attributes too?
“Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.” - Rich Cook
And will you succeed? Yes you will indeed! (98 and 3/4 % guaranteed) - Seuss. tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|