Skip to content

Commit 2e1e378

Browse files
authored
Create the-users-that-are-eligible-for-discount.sql
1 parent dec05e7 commit 2e1e378

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Time: O(n)
2+
# Space: O(n)
3+
4+
CREATE PROCEDURE getUserIDs(startDate DATE, endDate DATE, minAmount INT)
5+
BEGIN
6+
SELECT DISTINCT user_id
7+
FROM Purchases
8+
WHERE time_stamp >= startDate AND time_stamp <= endDate AND amount >= minAmount
9+
ORDER BY user_id;
10+
END

0 commit comments

Comments
 (0)