Company: Zomato_product_Analyst

Difficulty: medium

Problem Statement

Problem Description Write a SQL query that finds whichever user (or users) generated the most recognized revenue during July 2021. How much revenue a transaction counts for depends on its operation_type : A 'buy' counts 100% of the transaction amount toward revenue. A 'sell' counts only 10% of the transaction amount toward revenue. Separately, the transaction's status decides whether that revenue is recognized at all: 'completed' : the computed revenue counts in full. 'pending' or 'cancelled' : the transaction contributes nothing. Schema Table: transactions transaction_id (INT): Primary key for the transaction. user_id (INT): Identifier for the user performing the transaction. transaction_date (DATE): The date the transaction occurred. operation_type (VARCHAR): The type of operation, either 'buy' or 'sell' . status (VARCHAR): The state of the transaction, one of 'completed' , 'pending' , or 'cancelled' . amount (DECIMAL): The monetary value of the transaction. Assume all values are str

More Zomato_product_Analyst OA questionsInterview experiences