-
Notifications
You must be signed in to change notification settings - Fork 0
/
dr_spu_eco_20190619
171 lines (139 loc) · 5.62 KB
/
dr_spu_eco_20190619
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
create database data_request_spu_eco_luv2_20190609;
## Sample CSV import scripts
# Import for MPD records
create table data_request_spu_eco_luv2_20190609.sample_basin_parcels
(
parcel_id integer not null
,x_coord_sp float not null
,y_coord_sp float not null
,primary key (parcel_id)
);
LOAD DATA LOCAL INFILE 'T:/2019June/MarkS/SPU_Request/sample_parcels.csv'
INTO TABLE data_request_spu_eco_luv2_20190609.sample_basin_parcels
FIELDS TERMINATED BY ','
#ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 LINES
(
parcel_id
,x_coord_sp
,y_coord_sp
);
SELECT * FROM data_request_spu_eco_luv2_20190609.sample_basin_parcels s;
SELECT * FROM luv2_final_outputs_2040.buildings limit 10;
luv2_final_outputs_2040.buildings.building_id
luv2_final_outputs_2040.buildings.non_residential_sqft
luv2_final_outputs_2040.buildings.year_built
luv2_final_outputs_2040.buildings.not_demolish
luv2_final_outputs_2040.buildings.parcel_id
luv2_final_outputs_2040.buildings.job_capacity
luv2_final_outputs_2040.buildings.land_area
luv2_final_outputs_2040.buildings.improvement_value
luv2_final_outputs_2040.buildings.stories
luv2_final_outputs_2040.buildings.building_type_id
luv2_final_outputs_2040.buildings.template_id
luv2_final_outputs_2040.buildings.sqft_per_unit
luv2_final_outputs_2040.buildings.residential_units
SELECT
land_area
,year_built
,count(building_id)
FROM luv2_final_outputs_2040.buildings
where land_area = 0
group by
year_built,
land_area;
SELECT * FROM psrc_2014_parcel_baseyear.buildings where building_type_id = 19;
create table data_request_spu_eco_luv2_20190609.sample_basin_buildings_2040
select
luv2_final_outputs_2040.buildings.building_id
,luv2_final_outputs_2040.buildings.non_residential_sqft
,luv2_final_outputs_2040.buildings.year_built
,luv2_final_outputs_2040.buildings.not_demolish
,luv2_final_outputs_2040.buildings.parcel_id
,luv2_final_outputs_2040.buildings.job_capacity
,luv2_final_outputs_2040.buildings.land_area
,luv2_final_outputs_2040.buildings.improvement_value
,luv2_final_outputs_2040.buildings.stories
,luv2_final_outputs_2040.buildings.building_type_id
,luv2_final_outputs_2040.buildings.template_id
,luv2_final_outputs_2040.buildings.sqft_per_unit
,luv2_final_outputs_2040.buildings.residential_units
from luv2_final_outputs_2040.buildings
inner join data_request_spu_eco_luv2_20190609.sample_basin_parcels
on luv2_final_outputs_2040.buildings.parcel_id = data_request_spu_eco_luv2_20190609.sample_basin_parcels.parcel_id
;
create table data_request_spu_eco_luv2_20190609.sample_basin_buildings_2014
select
luv2_final_outputs_2014.buildings.building_id
,luv2_final_outputs_2014.buildings.non_residential_sqft
,luv2_final_outputs_2014.buildings.year_built
,luv2_final_outputs_2014.buildings.not_demolish
,luv2_final_outputs_2014.buildings.parcel_id
,luv2_final_outputs_2014.buildings.job_capacity
,luv2_final_outputs_2014.buildings.land_area
,luv2_final_outputs_2014.buildings.improvement_value
,luv2_final_outputs_2014.buildings.stories
,luv2_final_outputs_2014.buildings.building_type_id
,luv2_final_outputs_2014.buildings.template_id
,luv2_final_outputs_2014.buildings.sqft_per_unit
,luv2_final_outputs_2014.buildings.residential_units
from luv2_final_outputs_2014.buildings
inner join data_request_spu_eco_luv2_20190609.sample_basin_parcels
on luv2_final_outputs_2014.buildings.parcel_id = data_request_spu_eco_luv2_20190609.sample_basin_parcels.parcel_id
;
SELECT * FROM data_request_spu_eco_luv2_20190609.sample_basin_buildings_2040 s;
SELECT
tax_exempt_flag
,exemption
,count(parcel_id)
FROM luv2_final_outputs_2040.parcels
group by
tax_exempt_flag
,exemption
;
SELECT * FROM luv2_final_outputs_2040.parcels limit 10;
create table data_request_spu_eco_luv2_20190609.sample_basin_parcels_2014
select
luv2_final_outputs_2014.parcels.parcel_id
,luv2_final_outputs_2014.parcels.land_use_type_id
,luv2_final_outputs_2014.parcels.plan_type_id
,luv2_final_outputs_2014.parcels.x_coord_sp
,luv2_final_outputs_2014.parcels.y_coord_sp
,luv2_final_outputs_2014.parcels.use_code
,luv2_final_outputs_2014.parcels.unit_price
,luv2_final_outputs_2014.parcels.parcel_sqft
,luv2_final_outputs_2014.parcels.parcel_sqft_in_gis
,luv2_final_outputs_2014.parcels.land_value
,luv2_final_outputs_2014.parcels.tax_exempt_flag
,luv2_final_outputs_2014.parcels.exemption
,luv2_final_outputs_2014.parcels.zone_id
,luv2_final_outputs_2014.parcels.faz_id
,luv2_final_outputs_2014.parcels.city_id
from luv2_final_outputs_2014.parcels
inner join data_request_spu_eco_luv2_20190609.sample_basin_parcels
on luv2_final_outputs_2014.parcels.parcel_id = data_request_spu_eco_luv2_20190609.sample_basin_parcels.parcel_id
;
create table data_request_spu_eco_luv2_20190609.sample_basin_parcels_2040
select
luv2_final_outputs_2040.parcels.parcel_id
,luv2_final_outputs_2040.parcels.land_use_type_id
,luv2_final_outputs_2040.parcels.plan_type_id
,luv2_final_outputs_2040.parcels.x_coord_sp
,luv2_final_outputs_2040.parcels.y_coord_sp
,luv2_final_outputs_2040.parcels.use_code
,luv2_final_outputs_2040.parcels.unit_price
,luv2_final_outputs_2040.parcels.parcel_sqft
,luv2_final_outputs_2040.parcels.parcel_sqft_in_gis
,luv2_final_outputs_2040.parcels.land_value
,luv2_final_outputs_2040.parcels.tax_exempt_flag
,luv2_final_outputs_2040.parcels.exemption
,luv2_final_outputs_2040.parcels.zone_id
,luv2_final_outputs_2040.parcels.faz_id
,luv2_final_outputs_2040.parcels.city_id
from luv2_final_outputs_2040.parcels
inner join data_request_spu_eco_luv2_20190609.sample_basin_parcels
on luv2_final_outputs_2040.parcels.parcel_id = data_request_spu_eco_luv2_20190609.sample_basin_parcels.parcel_id
;
SELECT * FROM psrc_2014_parcel_baseyear.land_use_types l;
SELECT * FROM data_request_spu_eco_luv2_20190609.sample_basin_buildings_2040 s;