This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Get the number of orders for every customer signed in the last year: | |
WITH customers_with_orders AS MATERIALIZED ( -- [needs "MATERIALIZED" only for PG12+] | |
SELECT customer_id, signup_date, count(*) n_orders | |
FROM remote.customers c | |
JOIN remote.orders o ON c.id = o.customer_id | |
GROUP BY 1, 2 | |
) | |
SELECT * | |
FROM customers_with_orders | |
WHERE signup_date > current_date - 365 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import time | |
import requests | |
issues_url = 'https://api.github.com/repos/alan-eu/Topics/issues' | |
comments_url = 'https://api.github.com/repos/alan-eu/Topics/issues/comments' | |
rate_limit_url = 'https://api.github.com/rate_limit' | |
headers = {'Authorization': 'token <your_token>', 'Accept': 'application/vnd.github.v3+json'} |
OlderNewer