Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Queries in relational algebra. Consider the following relational database for ebay (www.ebay.com). Keys are represented in bold face . Item( ItemID , Name, SellerID, ReservePrice,

Queries in relational algebra.

Consider the following relational database for ebay (www.ebay.com). Keys are represented in bold face.

Item(ItemID, Name, SellerID, ReservePrice, InitialTimetoBid, LastTimetoBid, CurrentPrice)

Note: The reserve price is a non-published price set by the dealer. If no bids are made that equal that price, then the dealer does not have to sell the item. In the case that there is no set reserve price, the value of that attribute is set to zero. As bids are placed by the bidders, the price changes and becomes the current price (which can be smaller than the reserve price). The current price is always greater than the previous current price, that is, not all bids are acceptedonly those that are greater than the previous accepted bid. Items are made available at the InitialTimetoBid and all bidding must end at the LastTimetoBid. When that time is reached, the highest bidder will get the item (if the CurrentPrice is greater than the ReservePrice) and no new bids are accepted.

Bidder(BidderID, Name, Email, FeedbackRating, Country)

Seller(SellerID, Name, Email, FeedbackRating, Country)

Note: Bidders (respectively sellers) have a feedback rating, which is the average of the ratings provided by the sellers (respectively bidders) they have dealt with.

PaymentOption(SellerID, Option)

Note: Option can be Paypal, Visa, check, etc.

Belong(ItemID, CategoryName)

Note: Each item can be associated with one or more categories. For example, a painting can belong to categories Oil Painting if it is an oil painting and to category History, if it depicts a historical scene.

SubCategory(CategoryName, SubCategoryName)

Note: Categories are organized in a hierarchy. For example, Art Object can have as subcategories Painting, Sculpture, Tapestry, etc. In turn, the category Painting can have as subcategories Watercolor, Oil Painting, Acrylic Painting, etc.

Bid(BidderID, ItemID, Bidvalue, Time)

Note: We will assume that no two bidders bid at the same exact time. The same bidder can bid on an item more than once, at different times.

Queries: Write Relational Algebra expressions to answer the following queries:

Note: It is possible that a query (or queries) cannot be expressed using Relational Algebra. If this is the case, you must justify your answer.

(a) Find the names of the sellers who have a feedback rating greater than 95% and are offering at least one item for which the reserve price is greater than zero.

(b) For each bidder (bidderID), find the names of the sellers that are located in the same country and have some object in the category Oil Painting to sell.

(c) Find the IDs of the sellers who sell only items that belong to category Oil Painting.

(d) Find the IDs of the sellers who accept all the available forms of payment.

(e) Find the IDs of the sellers who have an oil painting for sale which has a set reserve price (i.e., a reserve price that is not zero) greater than the set reserve price of some oil painting put up for sale by any of the dealers in Denmark.

(f) Find the names of the bidders who placed a bid on at least one item belonging to a seller whose feedback rating is lower than their own.

(g) Find all the subcategories (at any level) of category Art Object.

(h) For each country, find the number of items that have been put up for auction.

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

Database Machine Performance Modeling Methodologies And Evaluation Strategies Lncs 257

Authors: Francesca Cesarini ,Silvio Salza

1st Edition

3540179429, 978-3540179429

More Books

Students also viewed these Databases questions

Question

14. List three techniques for developing paragraph coherence.

Answered: 1 week ago

Question

3. How has e-commerce transformed marketing?

Answered: 1 week ago