99999久久久久久亚洲,欧美人与禽猛交狂配,高清日韩av在线影院,一个人在线高清免费观看,啦啦啦在线视频免费观看www

熱線電話:13121318867

登錄
2022-12-30 閱讀量: 629
mysql 學(xué)習(xí)41--數(shù)據(jù)清洗

-- 淘寶案例數(shù)據(jù)準(zhǔn)備

create database taobao1123;

use taobao1123;

create table UserBehavior(

user_id int,

item_id int,

item_category int,

behavior_type varchar(10),

user_geohash varchar(10),

times datetime,

amount decimal(5,2)

);

load data infile "C:/ProgramData/MySQL/MySQL Server 8.0/Uploads/UserBehavior.csv"

into table UserBehavior

fields terminated by ',' ignore 1 lines;

select * from UserBehavior limit 10;

select count(*) from UserBehavior;#1048575


-- 1,數(shù)據(jù)清洗

-- 1.1 缺失值處理

###1.1.1缺失值數(shù)量

select

count(user_id),

count(item_id),

count(item_category),

count(behavior_type),

count(user_geohash),

count(times),

count(amount)

from UserBehavior;

###1.1.2缺失值比例

select

sum(user_id is null )/count(*),

sum(item_id is null)/count(*),

sum(item_category is null)/count(*),

sum(behavior_type is null)/count(*),

sum(user_geohash is null)/count(*),

sum(times is null)/count(*),

sum(amount is null)/count(*)

from UserBehavior;



-- 1.2 異常值檢查

select min(times),max(times),min(amount),max(amount) from UserBehavior;


-- 1.3 重復(fù)記錄處理

select distinct * from UserBehavior;


0.0000
0
關(guān)注作者
收藏
評論(0)

發(fā)表評論

暫無數(shù)據(jù)
推薦帖子