전체 글 (131) 썸네일형 리스트형 블록체인 수료증 MySQL 14강 select A.department, B.product_id, sum(C.reordered) / count(*) RET from instacart.departments A left join instacart.products B on A.department_id = B.department_id left join instacart.order_products__prior C on B.product_id = C.product_id group by 1,2; frozen496670.5000 frozen494160.5000 frozen493250.0000 frozen492960.0000 frozen492730.5000 select *, row_number() over(order by RET DESC) RNK from.. MySQL 13강 select avg(days_since_prior_order) from instacart.orders where order_number = 2; 13.6518 select count(product_id) / count(distinct order_id) UPT from instacart.order_products__prior; 10.0467 select count(distinct order_id) / count(distinct user_id) AF from instacart.orders; 1.0193 select product_id, sum(reordered) / count(*) from instacart.order_products__prior group by 1; 401740.5882 174610.705.. MySQL 12강 select count(distinct order_id) from instacart.orders; 3220 select count(distinct user_id) from instacart.orders; 3159 select * from instacart.order_products__prior A left join instacart.products B on A.product_id = B.product_id; select B.product_name, count(distinct A.order_id) from instacart.order_products__prior A left join instacart.products B on A.product_id = B.product_id group by B.produc.. MySQL 11-2강 select `Review Text`, case when `Review Text` like "%SIZE%" then 1 else 0 end SIZE_IN from mydata.dataset2; Absolutely wonderful - silky and sexy and comfortable0 Love this dress! it's sooo pretty. i happened to find it in a store, and i'm glad i did bc i never would have ordered it online bc it's petite. i bought a petite and am 5'8". i love the length on me- hits just a little below the knee. .. MySQL 11강 create table mydata.ST as select * from (select *, row_number() over(partition by `Department Name` order by avg_rate) as RNK from (select `Department Name`, `Clothing ID`, avg(Rating) as avg_rate from mydata.dataset2 group by 1, 2) A) B where RNK MySQL 10-2강 select `Division Name`, avg(rating) from mydata.dataset2 group by 1; Initmates4.1176 General4.1486 General Petite4.1839 select `Department Name`, avg(rating) from mydata.dataset2 group by 1; Intimate4.0917 Dresses4.0787 Bottoms4.2192 Tops4.1321 Jackets4.6232 Trend4.5556 select case when Age between 10 and 19 then "10" when Age between 20 and 29 then "20" when Age between 30 and 39 then "30" when.. MySQL 10강 select case when diff >= 90 then "Churn" else "N-Churn" end churn_type, count(distinct customerNumber) as N_CUS from (select customerNumber, "2005-06-01" as Now_d, max_order, datediff("2005-06-01", max_order) as Diff from (select customerNumber, max(orderDate) as max_order from classicmodels.orders group by customerNumber) as A) as B group by 1; Churn69 N-Churn29 select C.productLine, count(dist.. 이전 1 2 3 4 5 6 7 8 ··· 17 다음