Question: SQLITE3 QUERY QUESTION For each user who has had some bids, list the user email, the total number of distinct sales the user has had

SQLITE3 QUERY QUESTION

For each user who has had some bids, list the user email, the total number of distinct sales the user has had bids on, the number of winning bids, and the total dollar amount of the wining bids. The user has a winning bid if the sale is over (i.e., the end date is in the past), the user has the highest bid and the bid amount is not less than the reserved price. The result should include users who have no winning bids. Hint: subqueries can be used in the from clause.

  • users(email, name, pwd, city, gender)
  • products(pid, descr)
  • sales(sid, lister, pid, edate, descr, cond, rprice)
  • bids(bid, bidder, sid, bdate, amount)
  • items(sid, no, pid, descr)
  • reviews(reviewer, reviewee, rating, rtext, rdate)
  • previews(rid, pid, reviewer, rating, rtext, rdate)

Clarifications: The lister is represented by an email, bidder is represented by an email.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!