-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathassessor_data_2018_exploration
More file actions
198 lines (143 loc) · 6.57 KB
/
assessor_data_2018_exploration
File metadata and controls
198 lines (143 loc) · 6.57 KB
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# Exploring King County component tables
SELECT * FROM king_2018_parcel_baseyear.prep_buildings_1 where pin = '0685970000';
SELECT * FROM king_2018_parcel_baseyear.prep_buildings_condo_1 where pin = '0685970000';
SELECT * FROM king_2018_parcel_baseyear.prep_buildings_com_1 where pin = '0685970000';
SELECT * FROM king_2018_parcel_baseyear.prep_buildings_1 where pin = '1822059015';
SELECT * FROM king_2018_parcel_baseyear.prep_buildings_condo_1 where pin = '1822059015';
SELECT * FROM king_2018_parcel_baseyear.prep_buildings_com_1 where pin = '2693100068';
SELECT * FROM king_2018_parcel_baseyear.king_apartment_complex where Major = '198320' and Minor = '0605';
SELECT * FROM king_2018_parcel_baseyear.king_apartment_complex;
SELECT * FROM king_2018_parcel_baseyear.king_condo_complex;
SELECT * FROM king_2018_parcel_baseyear.extr_lookup e;
SELECT sum(LivingUnitCount) FROM king_2018_parcel_baseyear.king_residential_building k;
SELECT * FROM king_2018_parcel_baseyear.king_residential_building limit 20;
SELECT sum(UnitCount) FROM king_2018_parcel_baseyear.king_apartment_complex k;
SELECT sum(UnitCount) FROM king_2018_parcel_baseyear.king_condo_complex k;
SELECT * FROM king_2018_parcel_baseyear.prep_buildings_condo_1 order by sqft_per_unit asc;
SELECT * FROM king_2018_parcel_baseyear.prep_buildings_res_1 order by nbrlivingunits desc;
## 3rd Layer Tables
SELECT * FROM king_2018_parcel_baseyear.prep_buildings_1 limit 20;
SELECT * FROM king_2018_parcel_baseyear.prep_buildings_1_short limit 10;
SELECT
use_code
,use_code_txt
,count(pin) as records
FROM king_2018_parcel_baseyear.prep_buildings_1_short
group by use_code
;
select * FROM king_2018_parcel_baseyear.extr_lookup where LUType= 118;
select * FROM king_2018_parcel_baseyear.extr_lookup where LUItem between 340 and 350;
SELECT
LUType
,count(LUType) as entries
FROM king_2018_parcel_baseyear.extr_lookup
group by LUType ;
SELECT * FROM king_2018_parcel_baseyear.prep_buildings_1_short where use_code = 4;
Select * from king_2018_parcel_baseyear.prep_parcels_1 where pin = 1453601500;
## 2nd Layer Tables
SELECT * FROM king_2018_parcel_baseyear.extr_commbldg limit 10;
SELECT * FROM king_2018_parcel_baseyear.extr_resbldg limit 10;
## 1st Layer Tables
SELECT * FROM king_2018_parcel_baseyear.king_real_property_account limit 20;
SELECT * FROM king_2018_parcel_baseyear.king_residential_building limit 20;
SELECT * FROM king_2018_parcel_baseyear.king_parcel limit 20;
SELECT * FROM king_2018_parcel_baseyear.king_commercial_building limit 20;
SELECT * FROM king_2018_parcel_baseyear.king_apartment_complex limit 20;
SELECT * FROM king_2018_parcel_baseyear.king_condo_complex limit 20;
SELECT * FROM king_2018_parcel_baseyear.king_condo_unit limit 20;
########
########
########
## Exploring Kitsap County component tables
Select * from 2018_parcel_baseyear_working.buildings_20200219_hs where county_id = 35 and building_type_id = 12 and residential_units = 5 and gross_sqft < 2000;
SELECT * FROM kitsap_2018_parcel_baseyear.kitsap_commercial_improvement where RealPropertyAccountID = 1431808;
SELECT * FROM kitsap_2018_parcel_baseyear.kitsap_dwelling limit 10; #where RealPropertyAccountID = 1431808;
SELECT * FROM kitsap_2018_parcel_baseyear.kitsap_parcel where RealPropertyAccountID = 1431808;
SELECT * FROM kitsap_2018_parcel_baseyear.kitsap_valuation where RealPropertyAccountID = 1431808;
SELECT * FROM kitsap_2018_parcel_baseyear.main where RP_ACCT_ID = 1431808;
SELECT * FROM kitsap_2018_parcel_baseyear.main limit 10;
SELECT * FROM kitsap_2018_parcel_baseyear.land limit 10;
SELECT * FROM kitsap_2018_parcel_baseyear.flatats limit 10;
SELECT * FROM kitsap_2018_parcel_baseyear.buildings_assessor limit 10;
SELECT * FROM kitsap_2018_parcel_baseyear.prep_buildings limit 10;
#########
#########
#########
## Pierce County Digging
select * from pierce_2018_parcel_baseyear.prep_buildings_1 #limit 10;
#where parcelnumber = '8950001972';
where parcelnumber = '8950001895';
SELECT * FROM pierce_2018_parcel_baseyear.prep_parcels_1 limit 10;
select * from pierce_2018_parcel_baseyear.prep_parcels_1 #limit 10;
#where parcelnumber = '8950001972';
#where taxparceln = '8950001895'
where taxparceln = '0221068035'
;
## Is REFERENCE code for a stacked parcel?
create table pierce_2018_parcel_baseyear.temp_mhs_prep_parcels_w_reference
select * from pierce_2018_parcel_baseyear.prep_parcels_1 #limit 10;
#where parcelnumber = '8950001972';
#where taxparceln = '8950001895'
#where taxparcelt = 'Base Parcel'
where site_addre = 'REFERENCE'
;
select
parcel_id_fips
,building_id
,count(building_id) as records
,residential_units
from 2018_parcel_baseyear_working.buildings_20200219_hs where sqft_per_unit <100 and residential_units > 0
group by parcel_id_fips, building_id, residential_units
order by records desc
;
select * from pierce_2018_parcel_baseyear.prep_stacked_buildings_1 #limit 10;
#where parcelnumber = '8950001972';
where stacked_pin = '8950001895' or base_parcel = '8950001895';
select * from 2018_parcel_baseyear_working.buildings_20200219_hs where parcel_id_fips = 0319034005;
select * from 2018_parcel_baseyear_working.parcels where parcel_id_fips = '8950001895';
SELECT * FROM pierce_2018_parcel_baseyear.prep_stacked_buildings_1 where units>1 order by units desc;
create table pierce_2018_parcel_baseyear.mhs_temp
SELECT
base_parcel
,count(stacked_pin) as records
,sum(units) as tot_units
,max(units) as max_units
,min(units) as min_units
FROM pierce_2018_parcel_baseyear.prep_stacked_buildings_1
group by base_parcel
order by max_units desc
;
select * from pierce_2018_parcel_baseyear.mhs_temp;
select * from 2018_parcel_baseyear_working.buildings_20200219_hs
#where parcel_id_fips = '2000050011'
#where parcel_id_fips = '2033110011'
where parcel_id_fips = '0221068035'
;
SELECT * FROM pierce_2018_parcel_baseyear.temp_mhs_prep_parcels_w_reference t;
#########
#########
#########
## Exploring Snohomish County component tables
SELECT *
FROM snohomish_2018_parcel_baseyear.prep_buildings_1_20200207
where lrsnum = '1016512';
SELECT *
FROM snohomish_2018_parcel_baseyear.tmp_pud_stacked_with_pin_units
#where LRSN = 1016512
where PUD_Mtr_Ct between 200 and 300
order by PUD_Mtr_Ct
;
SELECT *
FROM snohomish_2018_parcel_baseyear.pudresmeter # Contains PUD_Mtr_Ct
where LRSN = '1016512';
SELECT *
FROM snohomish_2018_parcel_baseyear.snohomish_master
where LRSN = '1016512';
SELECT *
FROM snohomish_2018_parcel_baseyear.snohomish_land
where LRSNum = '1016512';
SELECT *
FROM snohomish_2018_parcel_baseyear.snohomish_improvement
where LRSNum = '1016512';
SELECT * FROM snohomish_2018_parcel_baseyear.tmp_pud_stacked_with_pin_units t;
SELECT * FROM snohomish_2018_parcel_baseyear.pudresmeter;