"Find all author that matches specific category and also show the most recently published first"
Consider Mapping rules
Entities and relationships -> Author and Book equality search attributes -> Category inequiality search attributes -> Not applicable ordering attributes -> publish_date key attributes -> book_id
. We are querying based on category, hence category must be in primary key. . Most recently published first , hence order by on publish_date order by descending . We need to make PK unique, hence we will as book_id in PK (It is 1 to many relationship, hence we will take key from many side, one author can write many books. Book_id will be unique in this relation. . Rest of the attributes from both the relation.
Question : Which one would you prefer , when data duplication is done because of schema design ?
Correct Answer : Get Lastest Questions and Answer : Explanation: : Constant duplication is fine. You must not have exponential and non-constant data duplication, it can cause your database storage filled faster and you will be out of space.
Question : You have been given below ER Diagram
What is the correct table design to satisfy below query?
Query: Find all books that is subscribed by a subscriber and support writing year range, with most writing year first then sorted by title.
Find all books that is subscribed by a subscriber and support writing year range, with most writing year first then sorted by title.
Consider Mapping Rules
Entities and relationships -> e-Book and e-Subscriber equality search attributes -> subscriber_id inequiality search attributes -> writing_year ordering attributes -> writing_year, title key attributes -> book_id,subscriber_id, subscription_date (because in m to m relationship, we take keys from both the enity as well as from relationship)