Uploaded by likeme231

1. Query to get the details of all

advertisement
1. Query to get the details of all items that are currently being auctioned, including the item number, title, description, starting bid, increment, start date, and end date:
SELECT item_number, title, description, starting_bid, increment, start_date, end_date
FROM mems.item
WHERE end_date > NOW()
This query will retrieve all items that are still being auctioned (i.e., the end date has not yet passed). It returns important details about each item that can be used to generate a report or to provide information to users who are interested in bidding on the items.
2. Query to get the total number of bids and the average bid amount for each item:
SELECT item_number, COUNT(*) AS total_bids, AVG(amount) AS average_bid
FROM mems.makes_bid
GROUP BY item_number
This query will count the number of bids made on each item and calculate the average bid amount for each item. It can be used to generate a report that provides an overview of bidding activity on each item.
3. Query to get the ratings and comments provided by buyers and sellers for a particular item:
SELECT c.item_no, c.ebuyer_id, c.buyer_rating, c.buyer_comment, c.eseller_id, c.seller_rating, c.seller_comment
FROM mems.comments c
INNER JOIN mems.item i ON i.item_number = c.item_no
WHERE i.item_number = <item_number>
This query will retrieve the ratings and comments provided by buyers and sellers for a specific item. It can be used to generate a report that provides feedback on the item and the users involved in the transaction. The <item_number> placeholder should be replaced with the actual item number for which the report is being generated.
Download