Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider a MARKETPLACE relational database schema description provided below which is used to manage a website where people can sell and buy used objects, where:

Consider a MARKETPLACE relational database schema description provided below which is used to manage a website where people can sell and buy used objects, where: - Each USER is a person in the system. Their personNick cant be used by any other user in the system. A user can sell and buy objects - Each OBJECT is defined by the USER id from the seller, and an object ID. That object ID is ONLY unique for each seller. Meaning that two different objects from different sellers can have the same object ID. The seller will write a description and set a cost for it. We will store the date it was created, and if it is sold or not and the date when it was sold. - Each object will belong to one or more CATEGORIES. Each category will have a unique ID. They will have a name and a description. The description can be empty. - When a user wants to buy an object will make a BUY_PROPOSAL that will reference the object and the person that is buying and will include the offered money. A user can only create one buy proposal per object. - The buyer and seller will be able to communicate through MESSAGES related to the BUY_PROPOSAL. A buy proposal can have (or not) multiple messages. Each message will have an ID that will match the order of the message, so 1, 2, 3. Meaning that messages related to different buy proposals, can have the same message id. - Note, datetime is stored in milliseconds, so it is not possible to post 2 or more objects or buy proposals or messages in the same exact time by the same user. BUT it is possible for 2 different users to create those items at the same time. The relations are: USER (PersonNick, FullName, BirthDate) OBJECT (ObjectId, SellerNick, CategoryId, Title, Description, Cost, Sold, DatePublished, DateSold ) CATEGORY(CategoryId, Name, Description) BUY_PROPOSAL (ObjectId, SellerNick, BuyerNick, Offer, DateCreated) PRIVATE_MESSAGE (MessageID, ObjectId, SellerNick, BuyerNick, Text, DateCreated) (a) Give a primary key for each relation. Are there any relations for which there is an alternate candidate key that you have not chosen as the primary key? If yes, mention the relations, candidate keys and the reason (if any) for your choice of the primary key. (b) How would you change the previous answer (candidate keys and primary keys) if the datetime attribute, instead store the exact instant with milliseconds only stored the day, month and year (allowing a user to have more than one post in the same day, or comments, etc). Explain your answer. Clue if you think that your answer wont change then you need to review your previous answer. (c) State all referential integrity constraints that should hold on these relations. Note: Use this format: TABLENAME AttributeA is FK references TABLENAME2(AttributeB)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transactions On Large Scale Data And Knowledge Centered Systems Xxviii Special Issue On Database And Expert Systems Applications Lncs 9940

Authors: Abdelkader Hameurlain ,Josef Kung ,Roland Wagner ,Qimin Chen

1st Edition

3662534541, 978-3662534540

More Books

Students also viewed these Databases questions

Question

Differentiate 3sin(9x+2x)

Answered: 1 week ago

Question

Compute the derivative f(x)=(x-a)(x-b)

Answered: 1 week ago