Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(253)

Issue 324650043: SQL scrip for task 1.3

Can't Edit
Can't Publish+Mail
Start Review
Created:
1 week, 4 days ago by brahim Al-Qaysi
Modified:
3 days, 15 hours ago
CC:
farzad2050, Wei Wang, yulianlluo, zhubiwen509
Visibility:
Public.

Description

SQL scrip for task 1.3 BUG=

Patch Set 1 #

Patch Set 2 : added more script #

Total comments: 3

Patch Set 3 : add more SQL scrip for creating tables that wil hold data from MaxMind task 1.3 #

Patch Set 4 : add more SQL scrip for creating tables that wil hold data from MaxMind task 1.3 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+35 lines, -1 line) Patch
A Task1_3.sql View 1 2 1 chunk +34 lines, -0 lines 0 comments Download
M task1.sql View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 2
brahim Al-Qaysi
added some SQL script for Task 1.3. More will be added later today
1 week, 4 days ago (2017-10-10 09:23:39 UTC) #1
manu_chaud
1 week, 4 days ago (2017-10-11 00:17:41 UTC) #2
https://codereview.appspot.com/324650043/diff/20001/Task1_3.sql
File Task1_3.sql (right):

https://codereview.appspot.com/324650043/diff/20001/Task1_3.sql#newcode3
Task1_3.sql:3: create table geoHops as select geoLocation.*
,GeoIp.startIpNum,GeoIp.endIpNum from geoLocation inner join GeoIp on
geoLocation.locId = GeoIp.locId;
Using capital letters for SQL keywords could improve readability

https://codereview.appspot.com/324650043/diff/20001/Task1_3.sql#newcode9
Task1_3.sql:9: select Hops.idHop, Hops.ipSrc, geoHops.* from Hops, geoHops where
INET_ATON(ipSrc) Between startIpNum and  endIpNum  AND idHop between 1 and 53020
AND ipSrc != '*' order by idHop asc INTO OUTFIlE
'/var/lib/mysql-files/geoHopsFinal.csv';
Version with headers (would help for readability of the resulting file):

select 'idHop', 'ipSrc', 'locId', 'country', 'region', 'city', 'postalCode',
'latitude', 'longitude', 'startIpNum', 'endIpNum' union all (select Hops.idHop,
Hops.ipSrc, geoHops.locId, geoHops.country, geoHops.region, geoHops.city,
geoHops.postalCode, geoHops.latitude, geoHops.longitude, geoHops.startIpNum,
geoHops.endIpNum from Hops, geoHops where INET_ATON(ipSrc) Between startIpNum
and endIpNum AND idHop between 1 and 25 AND ipSrc != '*' order by idHop asc INTO
OUTFIlE '/var/lib/mysql-files/test-manu.csv');

https://codereview.appspot.com/324650043/diff/20001/task1.sql
File task1.sql (right):

https://codereview.appspot.com/324650043/diff/20001/task1.sql#newcode18
task1.sql:18: create procedure wk()
all this function block should be indented, I guess
(or the two preceding lines should be unindented, and in this case the line "end
$$" & the next one should be unindented as well)
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 80a51fa-tainted