-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcat_count_y.sql
64 lines (51 loc) · 3.49 KB
/
cat_count_y.sql
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
use bankdb;
create table job_count_y(category varchar(20),count_ int)
row format delimited
fields terminated by ',';
insert into table job_count_y select job,count(job) from data_y group by(job);
insert overwrite local directory '/home/edureka/Desktop/count_data/job_y' row format delimited fields terminated by ',' select * from job_count_y;
create table marital_count_y(category varchar(20),count_ int)
row format delimited
fields terminated by ',';
insert into table marital_count_y select marital,count(marital) from data_y group by(marital);
insert overwrite local directory '/home/edureka/Desktop/count_data/marital_y' row format delimited fields terminated by ',' select * from marital_count_y;
create table education_count_y(category varchar(20),count_ int)
row format delimited
fields terminated by ',';
insert into table education_count_y select education,count(education) from data_y group by(education);
insert overwrite local directory '/home/edureka/Desktop/count_data/education_y' row format delimited fields terminated by ',' select * from education_count_y;
create table default_count_y(category varchar(20),count_ int)
row format delimited
fields terminated by ',';
insert into table default_count_y select default_,count(default_) from data_y group by(default_);
insert overwrite local directory '/home/edureka/Desktop/count_data/default_y' row format delimited fields terminated by ',' select * from default_count_y;
create table housing_count_y(category varchar(20),count_ int)
row format delimited
fields terminated by ',';
insert into table housing_count_y select housing,count(housing) from data_y group by(housing);
insert overwrite local directory '/home/edureka/Desktop/count_data/housing_y' row format delimited fields terminated by ',' select * from housing_count_y;
create table loan_count_y(category varchar(20),count_ int)
row format delimited
fields terminated by ',';
insert into table loan_count_y select loan,count(loan) from data_y group by(loan);
insert overwrite local directory '/home/edureka/Desktop/count_data/loan_y' row format delimited fields terminated by ',' select * from loan_count_y;
create table contact_count_y(category varchar(20),count_ int)
row format delimited
fields terminated by ',';
insert into table contact_count_y select contact,count(contact) from data_y group by(contact);
insert overwrite local directory '/home/edureka/Desktop/count_data/contact_y' row format delimited fields terminated by ',' select * from contact_count_y;
create table month_count_y(category varchar(20),count_ int)
row format delimited
fields terminated by ',';
insert into table month_count_y select month,count(month) from data_y group by(month);
insert overwrite local directory '/home/edureka/Desktop/count_data/month_y' row format delimited fields terminated by ',' select * from month_count_y;
create table poutcome_count_y(category varchar(20),count_ int)
row format delimited
fields terminated by ',';
insert into table poutcome_count_y select poutcome,count(poutcome) from data_y group by(poutcome);
insert overwrite local directory '/home/edureka/Desktop/count_data/poutcome_y' row format delimited fields terminated by ',' select * from poutcome_count_y;
create table target_count_y(category varchar(20),count_ int)
row format delimited
fields terminated by ',';
insert into table target_count_y select target,count(target) from data_y group by(target);
insert overwrite local directory '/home/edureka/Desktop/count_data/target_y' row format delimited fields terminated by ',' select * from target_count_y;