[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y ] [Search | Home]
4Archive logo
I was working on my database homework and...
If images are not shown try to refresh the page. If you like this website, please disable any AdBlock software!

You are currently reading a thread in /wsr/ - Worksafe Requests

Thread replies: 9
Thread images: 1
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
>>47289
OP here. So, there is no foreign key for storage, foreign key for ITEM is ST_CODE..Candidate keys for these tables could be ST_CODE, IT_CODE? .. and i'll do the entity integrity question.
>>
>>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.
Thread replies: 9
Thread images: 1
Thread DB ID: 488645



[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y] [Search | Home]

[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y] [Search | Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the shown content originated from that site. This means that 4Archive shows their content, archived. If you need information for a Poster - contact them.
If a post contains personal/copyrighted/illegal content, then use the post's [Report] link! If a post is not removed within 24h contact me at [email protected] with the post's information.