Answered step by step
Verified Expert Solution
Question
1 Approved Answer
plz reply asap plz plz Product sales You are given a table named product _ sales that contains information about the sales of various products
plz reply asap plz plz
Product sales
You are given a table named productsales that contains information about the sales of various products in a store.
Task
Retrieve the product details of the top bestselling products. If the products tie in the number of units sold, break the tie by alphabetical order of the product names.
Table description
Input format
Table: productsales
tableNameType,DescriptionproductidInt,Represents the unique product identifierproductname,Varchar,Represents the name of the productunitssold,Int,Represents the number of units sold
Output format
tableNameType,DescriptionproductidInt,Represents the unique product identifierproductname,Varchar,Represents the name of the productunitssold,Int,Represents the number of units sold
Example
Input table
Table: productsales
tableproductidproductname,unitssoldLaptop,Smartphone,Headphones,Tablet,Desktop,
Output table
tableproductidproductname,unitssoldSmartphone,Tablet,Laptop,
Note:
Your SQL query must be able to print the sample output from the provided sample input. However, the quer run against multiple hidden test cases. Therefore, your query must pass these hidden test cases to solve the problem statement.
Limits
Time Limit: for each input file
Memory Limit: MB
Source Limit: KB
Scoring
Score is assigned if any testcase passes
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started