Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Integrity 10. The below tables capture the 1-to-Many relationship between person

ID: 3596242 • Letter: I

Question

Integrity 10. The below tables capture the 1-to-Many relationship between persons owning pets: a person may own zero or more pet(s), while a pet is owned by at most one person (ie. it may be a stray and thus is not being owned by anybody). That said, the table has three violations of integrity rules. Name the kind of integrity rule violated, the exact spot in the table where the violation occurs and explain, why it is being violated! Please encircle & number the problem spots in the table and then provide the explanation referring to the number. (3 pts.) Table Person person_id (PK) Ifi 123 person firstname John Paul John verson last _name Smith Hatecats Smith 9876 99 Table Pet [person id (FK) 99 pet id (PK ) I pet_name Paulchen Marshmallow Softpaw 1234567 1234567

Explanation / Answer

Violation 1:
In the table Pet, row 1, there is no pet_id. But pet_id is a Primary key and it can not be null.

Violation 2:
In the table Pet, rows 2 and 3 have the same pet_id. But pet_id is a Primary key and it can not have repeating values. The values for pet_id column must be all different.

Violation 3:
person_id in table pet is a foreign key which referes to person_id column in table. Note there is a person_id 4 in the pet table, which is not there in the person table. This is a violation, because a foreign key column's value must be one of the primary key column values in the referred/main table.

Please let me know in case you have any doubt. Thank you!

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote