MeetCode
Aggregation Practice #32
C
C++
Computer Mathematics
CSS
DSA
HTML
Java
JavaScript
NodeJS
PHP
Programming Interview
Python
ReactJS
SQL
Run
Submit
Dark
Problem Statement
Solutions
Submissions
Aggregation Practice #32
Medium
Programming Interview
DBMS
22 views
Explanation
Complexity
Problem Statement
Table: Sales(store_id, amount). Return store_id and average amount, only stores with at least 5 rows.
Input Format
SQL tables are described in the question.
Output Format
Write the SQL query.
Input / Output Format
Input Format
SQL tables are described in the question.
Output Format
Write the SQL query.
Example Solution (Public)
Programming Interview
SELECT store_id, AVG(amount) AS avg_amount FROM Sales GROUP BY store_id HAVING COUNT(*) >= 5;
Official Solution Code
Wrap
Copy
SELECT store_id, AVG(amount) AS avg_amount FROM Sales GROUP BY store_id HAVING COUNT(*) >= 5;
Please
login
to submit solutions.
Editor
C
C++
Computer Mathematics
CSS
DSA
HTML
Java
JavaScript
NodeJS
PHP
Programming Interview
Python
ReactJS
SQL
Test Cases
Output
Submission Result
Input
Expected Output
Compile Output
Error
Output
Please
login
to submit solutions.