Advertisement
Guest User

Untitled

a guest
Apr 10th, 2016
1,935
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.86 KB | None | 0 0
  1. # LEAKED MERNIS DATABASE
  2.  
  3. ## Hazirlik ve Kurulum
  4.  
  5. Yeni kullanici ve database olusturulmasi:
  6.  
  7. ```psql
  8. USER mernis WITH PASSWORD 'password';
  9. CREATE DATABASE leak;
  10. GRANT ALL PRIVILEGES ON DATABASE leak to mernis;
  11. ```
  12.  
  13. Indirilen text dump dosyasinin yuklenemsi:
  14.  
  15. Not: 'ALTER TABLE public.citizen OWNER TO postgres;' satiri nedeniyle hata alinabilir, ya owner'i ya da
  16. dosyayi degistirerek bu hatayi cozebilirsiniz (ve ya gercek bir bilgisayari gibi hicbir sey yapmayin
  17. calismaya devam edecektir). Bu islem biraz uzun surebilir.
  18.  
  19. ```
  20. tar -zxvf mernis.tar.gz
  21. psql --username mernis --dbname leak < data_dump.sql
  22. ```
  23.  
  24. ## Database'e Baglanma ve Veri Kontrolu
  25.  
  26. ```
  27. psql --username mernis --dbname leak
  28. ```
  29.  
  30. Column ve Type'larini kontrol etmek icin:
  31.  
  32. ```
  33. leak=> \d citizen
  34. ```
  35.  
  36. ```
  37. ...
  38. national_identifier | text | not null
  39. first | text | not null
  40. last | text | not null
  41. mother_first | text | not null
  42. father_first | text | not null
  43. gender | character varying(1) | not null
  44. birth_city | text | not null
  45. date_of_birth | text | not null
  46. id_registration_city | text | not null
  47. id_registration_district | text | not null
  48. address_city | text | not null
  49. address_district | text | not null
  50. address_neighborhood | text | not null
  51. street_address | text | not null
  52. door_or_entrance_number | text | not null
  53. misc | text | not null
  54. ...
  55. ```
  56. ## Ornek Query'ler
  57.  
  58. ### Istanbul'da yasayip, kutugu Istanbul'da olmayan insan sayisi (tahmini goc rakami):
  59.  
  60. select count(id_registration_city) as number from citizen where address_city = 'ISTANBUL' and id_registration_city != 'ISTANBUL';
  61.  
  62. ```7151289```
  63.  
  64. ### Istanbul'a en cok goc veren ilk 10 il:
  65.  
  66. select id_registration_city, count(id_registration_city) as number from citizen where address_city = 'ISTANBUL' and id_registration_city != 'ISTANBUL' group by id_registration_city order by number desc limit 10;
  67.  
  68. ```
  69. id_registration_city | number
  70. ----------------------+--------
  71. SIVAS | 482309
  72. KASTAMONU | 363139
  73. GIRESUN | 318214
  74. ORDU | 310016
  75. TOKAT | 269422
  76. SAMSUN | 254651
  77. TRABZON | 250997
  78. MALATYA | 240064
  79. SINOP | 235073
  80. ERZINCAN | 210607
  81. ```
  82.  
  83. ### Istanbul'daki en yaygin ilk 10 erkek ismi:
  84.  
  85. select first, count(first) as number from citizen where address_city = 'ISTANBUL' and gender = 'E' group by first order by number desc limit 10;
  86.  
  87. ```
  88. first | number
  89. ---------+--------
  90. MEHMET | 140602
  91. MUSTAFA | 125941
  92. AHMET | 99865
  93. MURAT | 87946
  94. ALI | 86085
  95. HUSEYIN | 80489
  96. HASAN | 74948
  97. ISMAIL | 55221
  98. IBRAHIM | 54221
  99. OSMAN | 38662
  100. ```
  101.  
  102. ### Istanbul'daki en yaygin ilk 10 kadin ismi:
  103.  
  104. select first, count(first) as number from citizen where address_city = 'ISTANBUL' and gender = 'K' group by first order by number desc limit 10;
  105.  
  106. ```
  107. first | number
  108. ---------+--------
  109. FATMA | 154597
  110. AYSE | 114662
  111. EMINE | 103470
  112. HATICE | 84866
  113. ZEYNEP | 52833
  114. ELIF | 35430
  115. HULYA | 34558
  116. OZLEM | 33932
  117. SEVIM | 32574
  118. YASEMIN | 31844
  119. ```
  120.  
  121. ### Nufusu en az olan ilk 10 il:
  122.  
  123. select address_city, count(address_city) as number from citizen group by address_city order by number limit 10;
  124.  
  125. ```
  126. address_city | number
  127. --------------+--------
  128. BAYBURT | 49675
  129. ARDAHAN | 71240
  130. KILIS | 73608
  131. GUMUSHANE | 88319
  132. IGDIR | 103716
  133. TUNCELI | 110808
  134. HAKKARI | 119775
  135. ARTVIN | 122749
  136. YALOVA | 136767
  137. BARTIN | 138982
  138. ```
  139.  
  140. ### Kutuge kayitli insan sayisi en az olan ilk 10 il:
  141.  
  142. select id_registration_city, count(id_registration_city) as number from citizen group by id_registration_city order by number limit 10;
  143.  
  144. ```
  145. id_registration_city | number
  146. ----------------------+--------
  147. YALOVA | 90362
  148. HAKKARI | 137177
  149. KILIS | 160155
  150. BAYBURT | 163876
  151. IGDIR | 172665
  152. BILECIK | 198426
  153. KARAMAN | 218307
  154. BARTIN | 221850
  155. KARABUK | 233251
  156. TUNCELI | 234608
  157. ```
  158.  
  159. ### Turkiye genelinde en sik dogum gerceklesen ilk 10 gun:
  160.  
  161. select date_of_birth, count(date_of_birth) as number from citizen group by date_of_birth order by number limit 10;
  162.  
  163. ```
  164. date_of_birth | number
  165. ---------------+--------
  166. 1/1/1966 | 180577
  167. 1/1/1956 | 143843
  168. 1/1/1965 | 143244
  169. 1/1/1960 | 128328
  170. 1/1/1964 | 109443
  171. 1/1/1974 | 103824
  172. 1/1/1950 | 98385
  173. 1/1/1963 | 95640
  174. 1/1/1970 | 94237
  175. 1/1/1955 | 90063
  176. ```
  177.  
  178. ### Turkiye genelinde 1990 yilinda en sik dogum gerceklesen ilk 10 gun:
  179.  
  180. select date_of_birth, count(date_of_birth) as number from citizen where date_of_birth like '%/1990' group by date_of_birth order by number desc limit 10;
  181.  
  182. ```
  183. date_of_birth | number
  184. ---------------+--------
  185. 1/1/1990 | 67926
  186. 1/10/1990 | 11421
  187. 1/3/1990 | 11263
  188. 1/9/1990 | 11215
  189. 1/5/1990 | 11084
  190. 10/10/1990 | 10994
  191. 1/7/1990 | 10937
  192. 1/2/1990 | 10717
  193. 1/8/1990 | 10260
  194. 1/6/1990 | 9802
  195. ```
  196.  
  197. - Buyuk ihtimalle verideki dogum gunleri yanlis...
  198.  
  199. ### En cok dogumun gerceklestigi ilk 10 yil:
  200.  
  201. ```
  202. yil | number
  203. -------+--------
  204. 1981 | 773149
  205. 1980 | 725932
  206. 1984 | 705406
  207. 1982 | 705105
  208. 1989 | 701716
  209. 1986 | 698923
  210. 1985 | 695638
  211. 1990 | 694213
  212. 1983 | 692594
  213. 1979 | 685918
  214. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement