I was working on my database homework and I just completed the first question. I was wondering if anyone could check my answers quickly before I proceed to the next question. Thank you very much.
>>47278
It's been a while since I did databases, but isn't ST_CODE a foreign key in Item?
You seem to be saying it's a primary key in Storage and a foreign key in Storage, which seems wrong.
>>47281
yeah that was actually a typo. Since it's a primary key in storage, it's a foreign key in item
is the rest good? :o
>>47278
Also you've not addressed entity integrity.
>>47278
Not sure how ST_CONTACT can be a candidate key: what if the same guy hires two lockers?
>>47285
Though it doesn't strike me as a very fair question: "imagine what data might be in the database, and from that answer a question that can only be answered by looking at the data that we haven't given you".
>>47289
I said ". Entity integrity states that primary keys cannot be null, and that there needs to be a proper value in the primary key field. Primary keys are used to identify individual rows in a table, and if for example ST_CODE was missing for a row in the STORAGE table, then there would be a violation."
>>47293
>I said ". Entity integrity states that primary keys cannot be null, and that there needs to be a proper value in the primary key field.
The value also has to be unique.
>>47292
Candidate keys can be any column where the values meet the requirements of a primary key, i.e. every entry is non-null and unique. You can't really answer "what columns are candidate keys" without knowing what values are in them.