From 92a801a9733cef9f40d089cc9d37015eb0a2b641 Mon Sep 17 00:00:00 2001 From: Wael Almattar Date: Fri, 25 Oct 2024 14:24:41 +0200 Subject: [PATCH] feat: add query for calculating total market cap and stock count --- crates/proof-of-sql/examples/stocks/main.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/proof-of-sql/examples/stocks/main.rs b/crates/proof-of-sql/examples/stocks/main.rs index 25ccf67de..66faa74d1 100644 --- a/crates/proof-of-sql/examples/stocks/main.rs +++ b/crates/proof-of-sql/examples/stocks/main.rs @@ -90,4 +90,12 @@ fn main() { OwnedTable::try_from(stocks_batch).unwrap(), 0, ); + + // Query 1: Calculate total market cap and count of stocks + prove_and_verify_query( + "SELECT SUM(MarketCap) as total_market_cap, COUNT(*) as c FROM stocks", + &accessor, + &prover_setup, + &verifier_setup, + ); }