| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
- r/2
- 중복 컬럼
- 완성차CX전략
- 전동화트렌드
- union
- dense_rank()
- 자동차산업투자
- 데이터사이언스개론
- 고객여정설계
- SQL
- 기아고객경험
- 완성차브랜드전략
- stratascratch ID 10172
- 모빌리티경험
- between
- %_%
- 글로벌자동차시장
- FoD자동차
- 자동차CX전략
- 국내전기차보조금
- stratascratch
- 개인화모빌리티
- 티스토리챌린지
- 글로벌EV전략
- 오블완
- 현대자동차CX
- StrataScratch ID 2006
- 전기차시장전망
- 현대자동차전략
- 현대자동차커스터마이징
- Today
- Total
목록Study/SQL (18)
RE:cord
Return the total number of posts for each month, aggregated across all the years (i.e., posts in January 2019 and January 2020 are both combined into January). Output the month number (i.e., 1 for January, 2 for February) and the total number of posts in that month. Sum Up the Point : 각 월별 매출 1위 제품 찾기WITH MonthlySales AS ( -- 1. 월별, 상품별 총 매출액 계산하기 (여기서 준 수식을 넣음) SELECT MONTH(invoic..
Return the total number of posts for each month, aggregated across all the years (i.e., posts in January 2019 and January 2020 are both combined into January). Output the month number (i.e., 1 for January, 2 for February) and the total number of posts in that month. Summary: 각 월별로 묶고, 월별 개수를 count해라.SELECT MONTH(post_date) AS month, COUNT(*) AS total_postsFROM facebook_postsGROUP BY MONTH..
Q. Take the specific year and customerID and show the customer's Quantity of orders in that year.create function ff (@year int, @cus_n int)returns intas begin declare @quan varchar select @quan = count(*) from Sales.salesorderheader where year(OrderDate) = @year AND customerID = @cus_n return @quanendselect dbo.ff(2011, 29825) as QuantityOfOrder Q. If you were the Data Analyst in this company,..
What is UDF?The function helps users not to write the same query again.It means recycling.There are two types of Functions.1. Scalar Function - return the one output.2. Table-Valued Function - return various outputs in a table.Basic Formcreate function fufuncname (@prm1 datatype1, @pmr2 datatype..)returns datatypeasbegin return ReturnValueend EX1. function of adding two numberCREATE FUNCTION..
/*1. Leave an action user (with condition 3)2. Groups by country3. Calculation !! (how? -> main query count / sub query count)*/select pa.country, round( (count(case when last_active_date >= '2024-01-01' and sessions >= 5 and listening_hours >= 10 then 1 else null end)/ (select count(*) f..
select distinct user_id, count(*) over (partition by user_id) total_n_order, count(*) over (partition by order_date) total_valuefrom order_summarywhere user_id IN ( select os.user_id from order_summary os join sessions ss on os.user_id = ss.user_id where ss.session_date = os.order_date )order by user_id
Ketty gives Eve a task to generate a report containing three columns: Name, Grade and Mark. Ketty doesn't want the NAMES of those students who received a grade lower than 8. The report must be in descending order by grade -- i.e. higher grades are entered first. If there is more than one student with the same grade (8-10) assigned to them, order those particular students by their name alphabetic..