반응형
Notice
Recent Posts
Recent Comments
Link
«   2025/07   »
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 31
Archives
Today
Total
관리 메뉴

GBEY

[SQL] Udemy SQL 부트캠프 - 종합 도전 과제 1 본문

데이터분석

[SQL] Udemy SQL 부트캠프 - 종합 도전 과제 1

리스보아 2023. 8. 20. 09:12
반응형

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!

반응형