일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- stratascratch
- SQL
- 니트코드
- LeetCode
- 리트코드
- GenerativeAI
- 파이썬기초100제
- 파이썬
- 코드업
- Python3
- GenAI
- 릿코드
- 파이썬알고리즘
- sql코테
- 자연어처리
- 생성형AI
- nlp
- medium
- 투포인터
- Python
- 슬라이딩윈도우
- gcp
- Microsoft
- slidingwindow
- 구글퀵랩
- two-pointer
- dfs
- codeup
- 알고리즘
- heap
Archives
- Today
- Total
Tech for good
[Stratascratch/SQL] Find the total number of approved friendship requests in January and February 본문
IT/Data Science
[Stratascratch/SQL] Find the total number of approved friendship requests in January and February
Diana Kang 2025. 2. 26. 12:21

# Solution 1
SELECT COUNT(*) AS n_approved
FROM facebook_friendship_requests
WHERE MONTH(date_approved) IN(1,2);
# Solution 2
SELECT COUNT(*) AS n_approved
FROM facebook_friendship_requests
WHERE date_approved IS NOT NULL
AND DATE_FORMAT(date_approved, '%Y-%m') IN ('2019-01', '2019-02');
'IT > Data Science' 카테고리의 다른 글
[Stratascratch/SQL] Find the country that has the most companies listed on Forbes (0) | 2025.02.27 |
---|---|
[Stratascratch/SQL] User Feature Completion (0) | 2025.02.26 |
[Stratascratch/SQL] Daily Interactions By Users Count (0) | 2025.02.26 |
[Stratascratch/SQL] Successfully Sent Messages (0) | 2025.02.26 |
[파이썬 정규표현식] re.sub() (0) | 2021.10.29 |