Consider the following BOOK table and AUTHORSHIP table from the GBP. BOOK AUTHOR
ID: 3864188 • Letter: C
Question
Consider the following BOOK table and AUTHORSHIP table from the GBP. BOOK AUTHORSHIP A) The ISBN attribute appears in both tables. Explain (a) why it appears in the two tables, and (b) what relationship (1:1, or 1:M, or M:M) between the BOOK and AUTHORSHIP this attribute supports. Consider the two tables in Q4. What will happen in the following situations. Be specific for the situation. a) The deletion rule between the BOOK and AUTHORSHIP relation is set-to-null and an attempt is made to delete the record of ISBN "1234" in the BOOK relation. b) the deletion rule between the BOOK and AUTHORSHIP relations is restrict and an attempt is made to delete the record of ISBN "1234" in the BOOK relation. c) the rule between the BOOK and AUTHORSHIP relations is and an attempt is made to delete the record of ISBN "1234" in the BOOK relation.Explanation / Answer
Answer 4)
a) In above given both tables, attribute ISBN appears in Table BOOK as primary key uniquely identifies each Book ROW entry. But on the other hand, ISBN attribute in Table AUTHORSHIP works as foreign key referencing to the BOOK table entries and ISBN attribute also works with AuthorID as PRIMARY KEY for AUTHORSHIP table.
b) From the above given tables, ISBN attribute provides 1 : M relationship between these tables BOOK and AUTHORSHIP because 1 book can be co-authored by many authors as also shown in above database.
Answer 5)
a) A foreign key with "set null on delete" means that if a record in the parent table is deleted, then the corresponding records in the child table will have the foreign key fields set to NULL. So if an attempt is made to delete the record ISBN "1234" in BOOK table, all the entries with ISBN "1234" in AUTHORSHIP table gets updated to NULL
b) A foreign key with " RESTRICT delete rule" means that If a row from children table has this attribute, then it cannot be deleted from the parent table. So the attempt to delete the record ISBN "1234" in BOOK table gets FAILED
c) A foreign key with " CASCADE delete rule" means that If a parent row is deleted, all child rows associated with this parent row is automatically deleted from the child table. So if an attempt is made to delete the record ISBN "1234" in BOOK table, all the entries with ISBN "1234" in AUTHORSHIP table gets automatically deleted also.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.