반응형
Notice
Recent Posts
Recent Comments
Link
GBEY
[SQL] Udemy SQL 부트캠프 - 종합 도전 과제 1 본문
반응형
Challenge
1. How many payment transactions were greater than $5.00?
SELECT COUNT(*) FROM payment
WHERE amount > 5.00;
2. How many actors have a first name that starts with the letter P?
SELECT COUNT(*) FROM actor
WHERE first_name LIKE('P%');
3. How many unique districts are out customers from?
SELECT COUNT (DISTINCT district) FROM address;
4. Retrieve the list of names for those distinct districts from the previous question.
SELECT DISTINCT district FROM address;
5. How many films have a rating of R and a replacement cost between $5 and $15?
SELECT COUNT(*) FROM film
WHERE rating = 'R'
AND replacement_cost BETWEEN 5 AND 15;
6. How many films have the word Truman somewhere in the title?
SELECT COUNT(*) FROM film
WHERE title LIKE '%Truman%';
기초문제인데 틀리면 어쩌나 했는데
다행히 다 맞음(*^▽^*)
이제 다음 강의는 GROUP BY!
반응형
'데이터분석' 카테고리의 다른 글
[SQL] GROUP BY란? + pgAdmin으로 연습하기 (0) | 2023.08.24 |
---|---|
[SQL] HAVING이란? + pgAdmin으로 연습하기 (0) | 2023.08.24 |
[SQL] 기초 복습 - 집계 함수의 정의, 특징, 사용법 (1) | 2023.08.23 |
[통계학] 기초통계 복습 #1 - 변수, 분포, 평균 등 (1) | 2023.08.20 |
[SQL] 기초 복습 - LIMIT, BETWEEN, IN, LIKE 와 ILIKE (0) | 2023.08.19 |