Skip to content

Commit ed86daf

Browse files
committed
Solve comments formatting for sql
1 parent 2342351 commit ed86daf

File tree

4 files changed

+12
-23
lines changed

4 files changed

+12
-23
lines changed

Geographical Information/geocoding and mapping/01_geocoding/01_import_results.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ddl for pre geo table (address still there, not unique long, lat pairs)
1+
-- ddl for pre geo table (address still there, not unique long, lat pairs)
22

33
drop table if exists geo_location_raw;
44
create table patstatAvr2017_lab.`geo_location_raw` (
@@ -19,7 +19,7 @@ create table patstatAvr2017_lab.`geo_location_raw` (
1919
`location_id` int(11) default null
2020
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2121

22-
# load exported csv from sqlite into it
22+
-- load exported csv from sqlite into it
2323

2424
load data local infile
2525
'/home/luisd/tmp/geo_locations.csv'

Geographical Information/geocoding and mapping/01_geocoding/02_01_geo_location.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ddl for new geo table
1+
-- ddl for new geo table
22

33
drop table if exists patstatAvr2017_lab.`geo_location`;
44
CREATE TABLE patstatAvr2017_lab.`geo_location` (
@@ -13,14 +13,14 @@ CREATE TABLE patstatAvr2017_lab.`geo_location` (
1313
primary key (location_id)
1414
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1515

16-
# insert the unique ones
16+
-- insert the unique ones
1717

1818
insert into geo_location(label, longitude, latitude, city, region, country, iso3)
1919
select
2020
label, longitude, latitude, city, region, country, iso3
2121
from geo_location_raw where latitude is not null group by longitude, latitude, label; # 315 628
2222

23-
# indexes
23+
-- indexes
2424

2525
create index long_lat_idx using btree on geo_location(longitude, latitude);
2626
create index label_idx using btree on geo_location(label(300));

Geographical Information/geocoding and mapping/01_geocoding/03_geo_addresses.sql

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ddl for new address table
1+
-- ddl for new address table
22

33
drop table if exists patstatAvr2017_lab.geo_addresses;
44

@@ -18,15 +18,15 @@ create table patstatAvr2017_lab.geo_addresses (
1818
key `iso_ctry_idx` (`iso_ctry`)
1919
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2020

21-
# copy its content from previous address table
21+
-- copy its content from previous address table
2222

2323
insert into patstatAvr2017_lab.geo_addresses(addr_final, addr_final_norm, iso_ctry)
2424
select
2525
adr_final, adr_final_norm_trim as addr_final_norm, iso_ctry
2626
from
2727
patstatAvr2017_lab.04_addr_list; # 7 635 653
2828

29-
# from raw address table to geo_addresses using the addr_harm field (trimmed)
29+
-- from raw address table to geo_addresses using the addr_harm field (trimmed)
3030

3131
select count(*) from geo_addresses; # 7 635 653
3232
select count(*) from geo_location_raw; # 2 394 385
@@ -42,15 +42,4 @@ set
4242
big.confidence = small.confidence,
4343
big.accuracy = small.accuracy,
4444
big.layer = small.layer; # 2 447 106
45-
46-
47-
48-
49-
50-
51-
52-
53-
54-
55-
5645

Geographical Information/geocoding and mapping/01_geocoding/04_propagate_to_bigger_tables.sql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Propagate to bigger tables
1+
-- Propagate to bigger tables
22

3-
# Add address id
3+
-- Add address id
44

55
alter table patstatAvr2017.applt_addr_ifris add addr_id int(11);
66
alter table patstatAvr2017.invt_addr_ifris add addr_id int(11);
77

8-
# bring values from geo_addresses
8+
-- bring values from geo_addresses
99

1010
update
1111
patstatAvr2017.applt_addr_ifris applt
@@ -23,4 +23,4 @@ update
2323
set
2424
invt.addr_id = addr.addr_id;
2525

26-
select * from patstatAvr2017.invt_addr_ifris;
26+
select * from patstatAvr2017.invt_addr_ifris;

0 commit comments

Comments
 (0)