pub const CREATE: &str = "-- A self-made query that covers dynamic filter and simple aggregation.\n--\n-- Show the auctions whose count of bids is greater than the overall average count of bids\n-- per auction.\n\nCREATE MATERIALIZED VIEW nexmark_q102\nAS\nSELECT\n a.id AS auction_id,\n a.item_name AS auction_item_name,\n COUNT(b.auction) AS bid_count\nFROM auction a\nJOIN bid b ON a.id = b.auction\nGROUP BY a.id, a.item_name\nHAVING COUNT(b.auction) >= (\n SELECT COUNT(*) / COUNT(DISTINCT auction) FROM bid\n);\n";