We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
The question is a bit confusing, there are two case scenarios.
Case 1 - If we just look at the data, Booknames are not repeated anywhere.
And we don't have to think about the test case since we just have to consider this particular data, also in test case it is written that no test
cases are there in this question.
Case 2 - If we start considering the test cases, bookname and author will be composite key and
can we consider them as primary key. But the people who are not from the book publishing industry might not know that, two books can't have
the same name since there is a copyright issue. So, the bookname is the primary key.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Databases - Keys
You are viewing a single comment's thread. Return to all comments →
The question is a bit confusing, there are two case scenarios.
Case 1 - If we just look at the data, Booknames are not repeated anywhere. And we don't have to think about the test case since we just have to consider this particular data, also in test case it is written that no test cases are there in this question.
Case 2 - If we start considering the test cases, bookname and author will be composite key and can we consider them as primary key. But the people who are not from the book publishing industry might not know that, two books can't have the same name since there is a copyright issue. So, the bookname is the primary key.