You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bill_id is the primary key (column with unique values) for this table.
12
+
Each row contains information about the amount of one bill and the customer associated with it.
13
+
</pre>
14
+
15
+
<p> </p>
16
+
17
+
<p>Write a solution to report the number of customers who had <strong>at least one</strong> bill with an amount <strong>strictly greater</strong> than <code>500</code>.</p>
18
+
19
+
<p>The result format is in the following example.</p>
20
+
21
+
<p> </p>
22
+
<p><strongclass="example">Example 1:</strong></p>
23
+
24
+
<pre>
25
+
<strong>Input:</strong>
26
+
Store table:
27
+
+---------+-------------+--------+
28
+
| bill_id | customer_id | amount |
29
+
+---------+-------------+--------+
30
+
| 6 | 1 | 549 |
31
+
| 8 | 1 | 834 |
32
+
| 4 | 2 | 394 |
33
+
| 11 | 3 | 657 |
34
+
| 13 | 3 | 257 |
35
+
+---------+-------------+--------+
36
+
<strong>Output:</strong>
37
+
+------------+
38
+
| rich_count |
39
+
+------------+
40
+
| 2 |
41
+
+------------+
42
+
<strong>Explanation:</strong>
43
+
Customer 1 has two bills with amounts strictly greater than 500.
44
+
Customer 2 does not have any bills with an amount strictly greater than 500.
45
+
Customer 3 has one bill with an amount strictly greater than 500.
0 commit comments