Question: Please I need Answer in Mysql ONLY!!! For all the merchants defined in the merchant table, output the risky shoppers. Risky shopper are shoppers who

Please I need Answer in Mysql ONLY!!!

Please I need Answer in Mysql ONLY!!! For all the merchants definedin the merchant table, output the risky shoppers. Risky shopper are shoppers

For all the merchants defined in the merchant table, output the risky shoppers. Risky shopper are shoppers who have an average risk score of 100.00 (rounded to 2 decimals) or more. For each merchant-shopper pair, please output: merchantName , hashedShopper Reference, averageRiskScore, totalNumberOfTransactions. Order the results first ascendingly by merchantName and descendingly by averageRiskScore of the shopper. Schema You are provided 2 tables: transaction, merchant transaction Name Type Description transactionld INTEGER Unique reference to identify this transaction. (Primary key) merchantld INTEGER Uniquely references the merchant using their assigned id. TEXT Description of item bought description quantity INTEGER Quantity in minor units (1.00 USD -> 100) currencyld INTEGER ISO 4217 currency_id (USD -> 840) hashedShopper Reference TEXT Reference that uniquely identifies a shopper across multiple transactions riskScore INTEGER Risk score between 0-10000 merchant Name Type Description merchantld INTEGER Unique reference to identify this merchant (Primary key) merchantName VARCHAR(200) DBA name of the merchant (Unique) merchant Name Type Description merchantld INTEGER Unique reference to identify this merchant (Primary key) merchantName VARCHAR(200) DBA name of the merchant (Unique) Sample Data Tables transaction transactionld merchantld description quantity currencyld hashedShopperReference riskScore 1 1 Blue Swirl Candle 500 840 508048e3e673b444 99 N 1 Torch 2000 840 508048e3e673b444 103 3 1 Candle Stand 300 840 99e5dbf13c8291x9 99 4 2 Cappuccino 350 840 e80999e5dbf13cfb9b 99 5 2 Latte 400 840 508048e3e673b444 100 merchant merchantld merchantName 1 Candle Store Inc. 2 Local Coffee Roastery LLC Expected output: Candle Store Inc. 508048e3e673b444 101.00 2 Local Coffee Roastery LLC 508048e3e6736444 100.00 1

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!