Skip to content

Commit

Permalink
Merge pull request #1 from KazuhiroM/update-sql
Browse files Browse the repository at this point in the history
Issue #8
  • Loading branch information
KazuhiroM authored Jul 5, 2020
2 parents 88173fd + 5558bc4 commit 5c05332
Showing 1 changed file with 123 additions and 124 deletions.
247 changes: 123 additions & 124 deletions docker/work/answer/ans_preprocess_knock_SQL.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5467,58 +5467,58 @@
" <th>coalesce</th>\n",
" </tr>\n",
" <tr>\n",
" <td>CS001112000009</td>\n",
" <td>CS021313000114</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <td>CS001112000019</td>\n",
" <td>0</td>\n",
" <td>CS031415000172</td>\n",
" <td>5088</td>\n",
" </tr>\n",
" <tr>\n",
" <td>CS001112000021</td>\n",
" <td>CS028811000001</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <td>CS001112000023</td>\n",
" <td>0</td>\n",
" <td>CS001215000145</td>\n",
" <td>875</td>\n",
" </tr>\n",
" <tr>\n",
" <td>CS001112000024</td>\n",
" <td>0</td>\n",
" <td>CS015414000103</td>\n",
" <td>3122</td>\n",
" </tr>\n",
" <tr>\n",
" <td>CS001112000029</td>\n",
" <td>0</td>\n",
" <td>CS033513000180</td>\n",
" <td>868</td>\n",
" </tr>\n",
" <tr>\n",
" <td>CS001112000030</td>\n",
" <td>CS035614000014</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <td>CS001113000004</td>\n",
" <td>1298</td>\n",
" <td>CS011215000048</td>\n",
" <td>3444</td>\n",
" </tr>\n",
" <tr>\n",
" <td>CS001113000010</td>\n",
" <td>CS009413000079</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <td>CS001114000005</td>\n",
" <td>626</td>\n",
" <td>CS040412000191</td>\n",
" <td>210</td>\n",
" </tr>\n",
"</table>"
],
"text/plain": [
"[('CS001112000009', 0),\n",
" ('CS001112000019', 0),\n",
" ('CS001112000021', 0),\n",
" ('CS001112000023', 0),\n",
" ('CS001112000024', 0),\n",
" ('CS001112000029', 0),\n",
" ('CS001112000030', 0),\n",
" ('CS001113000004', 1298),\n",
" ('CS001113000010', 0),\n",
" ('CS001114000005', 626)]"
"[('CS021313000114', 0),\n",
" ('CS031415000172', 5088),\n",
" ('CS028811000001', 0),\n",
" ('CS001215000145', 875),\n",
" ('CS015414000103', 3122),\n",
" ('CS033513000180', 868),\n",
" ('CS035614000014', 0),\n",
" ('CS011215000048', 3444),\n",
" ('CS009413000079', 0),\n",
" ('CS040412000191', 210)]"
]
},
"execution_count": 40,
Expand All @@ -5540,7 +5540,6 @@
"ON c.customer_id = a.customer_id\n",
"WHERE c.gender_cd = '1'\n",
" and c.customer_id not like 'Z%'\n",
"ORDER BY customer_id\n",
"LIMIT 10"
]
},
Expand Down Expand Up @@ -10267,17 +10266,17 @@
" <th>status_cd</th>\n",
" </tr>\n",
" <tr>\n",
" <td>CS029415000023</td>\n",
" <td>梅田 里穂</td>\n",
" <td>CS017412000200</td>\n",
" <td>川野 さとみ</td>\n",
" <td>1</td>\n",
" <td>女性</td>\n",
" <td>1976-01-17</td>\n",
" <td>43</td>\n",
" <td>279-0043</td>\n",
" <td>千葉県浦安市富士見**********</td>\n",
" <td>S12029</td>\n",
" <td>20150610</td>\n",
" <td>D-20100918-E</td>\n",
" <td>1970-11-30</td>\n",
" <td>48</td>\n",
" <td>166-0004</td>\n",
" <td>東京都杉並区阿佐谷南**********</td>\n",
" <td>S13017</td>\n",
" <td>20160302</td>\n",
" <td>0-00000000-0</td>\n",
" </tr>\n",
" <tr>\n",
" <td>CS001515000096</td>\n",
Expand All @@ -10293,122 +10292,122 @@
" <td>A-20100724-7</td>\n",
" </tr>\n",
" <tr>\n",
" <td>CS020513000020</td>\n",
" <td>岡村 愛子</td>\n",
" <td>1</td>\n",
" <td>女性</td>\n",
" <td>1963-04-20</td>\n",
" <td>55</td>\n",
" <td>115-0056</td>\n",
" <td>東京都北区西が丘**********</td>\n",
" <td>S13020</td>\n",
" <td>20151224</td>\n",
" <td>CS002503000087</td>\n",
" <td>松居 ケンイチ</td>\n",
" <td>0</td>\n",
" <td>男性</td>\n",
" <td>1960-05-09</td>\n",
" <td>58</td>\n",
" <td>187-0021</td>\n",
" <td>東京都小平市上水南町**********</td>\n",
" <td>S13002</td>\n",
" <td>20160613</td>\n",
" <td>0-00000000-0</td>\n",
" </tr>\n",
" <tr>\n",
" <td>CS044412000021</td>\n",
" <td>紺野 愛</td>\n",
" <td>CS029415000273</td>\n",
" <td>本山 あい</td>\n",
" <td>1</td>\n",
" <td>女性</td>\n",
" <td>1977-06-13</td>\n",
" <td>41</td>\n",
" <td>210-0014</td>\n",
" <td>神奈川県川崎市川崎区貝塚**********</td>\n",
" <td>S13044</td>\n",
" <td>20171130</td>\n",
" <td>4-20100321-6</td>\n",
" <td>1973-02-16</td>\n",
" <td>46</td>\n",
" <td>279-0003</td>\n",
" <td>千葉県浦安市海楽**********</td>\n",
" <td>S12029</td>\n",
" <td>20160903</td>\n",
" <td>0-00000000-0</td>\n",
" </tr>\n",
" <tr>\n",
" <td>CS008502000023</td>\n",
" <td>臼井 貴嶺</td>\n",
" <td>0</td>\n",
" <td>男性</td>\n",
" <td>1962-06-30</td>\n",
" <td>56</td>\n",
" <td>213-0031</td>\n",
" <td>神奈川県川崎市高津区宇奈根**********</td>\n",
" <td>S13008</td>\n",
" <td>20150612</td>\n",
" <td>0-00000000-0</td>\n",
" </tr>\n",
" <tr>\n",
" <td>CS051513000001</td>\n",
" <td>三宅 芽以</td>\n",
" <td>CS040512000188</td>\n",
" <td>久野 美紀</td>\n",
" <td>1</td>\n",
" <td>女性</td>\n",
" <td>1964-06-05</td>\n",
" <td>54</td>\n",
" <td>115-0056</td>\n",
" <td>東京都北区西が丘**********</td>\n",
" <td>S13051</td>\n",
" <td>20180502</td>\n",
" <td>1959-04-28</td>\n",
" <td>59</td>\n",
" <td>226-0027</td>\n",
" <td>神奈川県横浜市緑区長津田**********</td>\n",
" <td>S14040</td>\n",
" <td>20160203</td>\n",
" <td>0-00000000-0</td>\n",
" </tr>\n",
" <tr>\n",
" <td>CS003515000209</td>\n",
" <td>奥貫 璃子</td>\n",
" <td>CS009513000178</td>\n",
" <td>草野 恵梨香</td>\n",
" <td>1</td>\n",
" <td>女性</td>\n",
" <td>1961-06-12</td>\n",
" <td>57</td>\n",
" <td>201-0001</td>\n",
" <td>東京都狛江市西野川**********</td>\n",
" <td>S13003</td>\n",
" <td>20150617</td>\n",
" <td>B-20100509-B</td>\n",
" <td>1965-11-05</td>\n",
" <td>53</td>\n",
" <td>158-0095</td>\n",
" <td>東京都世田谷区瀬田**********</td>\n",
" <td>S13009</td>\n",
" <td>20150524</td>\n",
" <td>C-20100808-9</td>\n",
" </tr>\n",
" <tr>\n",
" <td>CS038314000106</td>\n",
" <td>中井 璃奈子</td>\n",
" <td>CS024512000042</td>\n",
" <td>平塚 奈月</td>\n",
" <td>1</td>\n",
" <td>女性</td>\n",
" <td>1981-04-22</td>\n",
" <td>37</td>\n",
" <td>279-0043</td>\n",
" <td>千葉県浦安市富士見**********</td>\n",
" <td>S13038</td>\n",
" <td>20180714</td>\n",
" <td>1959-06-04</td>\n",
" <td>59</td>\n",
" <td>216-0015</td>\n",
" <td>神奈川県川崎市宮前区菅生**********</td>\n",
" <td>S14024</td>\n",
" <td>20150702</td>\n",
" <td>0-00000000-0</td>\n",
" </tr>\n",
" <tr>\n",
" <td>CS016312000018</td>\n",
" <td>倉本 華子</td>\n",
" <td>CS015614000010</td>\n",
" <td>井田 真奈美</td>\n",
" <td>1</td>\n",
" <td>女性</td>\n",
" <td>1986-02-23</td>\n",
" <td>33</td>\n",
" <td>187-0011</td>\n",
" <td>東京都小平市鈴木町**********</td>\n",
" <td>S13016</td>\n",
" <td>20140926</td>\n",
" <td>1954-06-09</td>\n",
" <td>64</td>\n",
" <td>136-0076</td>\n",
" <td>東京都江東区南砂**********</td>\n",
" <td>S13015</td>\n",
" <td>20150516</td>\n",
" <td>0-00000000-0</td>\n",
" </tr>\n",
" <tr>\n",
" <td>CS009614000045</td>\n",
" <td>葛西 優</td>\n",
" <td>CS011312000090</td>\n",
" <td>米沢 ヒカル</td>\n",
" <td>1</td>\n",
" <td>女性</td>\n",
" <td>1957-10-23</td>\n",
" <td>61</td>\n",
" <td>154-0015</td>\n",
" <td>東京都世田谷区桜新町**********</td>\n",
" <td>S13009</td>\n",
" <td>20150311</td>\n",
" <td>5-20080701-2</td>\n",
" </tr>\n",
" <tr>\n",
" <td>CS023304000005</td>\n",
" <td>横川 慶二</td>\n",
" <td>0</td>\n",
" <td>男性</td>\n",
" <td>1984-01-06</td>\n",
" <td>35</td>\n",
" <td>212-0012</td>\n",
" <td>神奈川県川崎市幸区中幸町**********</td>\n",
" <td>S14023</td>\n",
" <td>20151126</td>\n",
" <td>6-20100423-9</td>\n",
" <td>1984-12-31</td>\n",
" <td>34</td>\n",
" <td>211-0066</td>\n",
" <td>神奈川県川崎市中原区今井西町**********</td>\n",
" <td>S14011</td>\n",
" <td>20141213</td>\n",
" <td>0-00000000-0</td>\n",
" </tr>\n",
"</table>"
],
"text/plain": [
"[('CS029415000023', '梅田 里穂', '1', '女性', datetime.date(1976, 1, 17), 43, '279-0043', '千葉県浦安市富士見**********', 'S12029', '20150610', 'D-20100918-E'),\n",
"[('CS017412000200', '川野 さとみ', '1', '女性', datetime.date(1970, 11, 30), 48, '166-0004', '東京都杉並区阿佐谷南**********', 'S13017', '20160302', '0-00000000-0'),\n",
" ('CS001515000096', '水野 陽子', '9', '不明', datetime.date(1960, 11, 29), 58, '144-0053', '東京都大田区蒲田本町**********', 'S13001', '20150614', 'A-20100724-7'),\n",
" ('CS020513000020', '岡村 愛子', '1', '女性', datetime.date(1963, 4, 20), 55, '115-0056', '東京都北区西が丘**********', 'S13020', '20151224', '0-00000000-0'),\n",
" ('CS044412000021', '紺野 愛', '1', '女性', datetime.date(1977, 6, 13), 41, '210-0014', '神奈川県川崎市川崎区貝塚**********', 'S13044', '20171130', '4-20100321-6'),\n",
" ('CS051513000001', '三宅 芽以', '1', '女性', datetime.date(1964, 6, 5), 54, '115-0056', '東京都北区西が丘**********', 'S13051', '20180502', '0-00000000-0'),\n",
" ('CS003515000209', '奥貫 璃子', '1', '女性', datetime.date(1961, 6, 12), 57, '201-0001', '東京都狛江市西野川**********', 'S13003', '20150617', 'B-20100509-B'),\n",
" ('CS038314000106', '中井 璃奈子', '1', '女性', datetime.date(1981, 4, 22), 37, '279-0043', '千葉県浦安市富士見**********', 'S13038', '20180714', '0-00000000-0'),\n",
" ('CS016312000018', '倉本 華子', '1', '女性', datetime.date(1986, 2, 23), 33, '187-0011', '東京都小平市鈴木町**********', 'S13016', '20140926', '0-00000000-0'),\n",
" ('CS009614000045', '葛西 優', '1', '女性', datetime.date(1957, 10, 23), 61, '154-0015', '東京都世田谷区桜新町**********', 'S13009', '20150311', '5-20080701-2'),\n",
" ('CS023304000005', '横川 慶二', '0', '男性', datetime.date(1984, 1, 6), 35, '212-0012', '神奈川県川崎市幸区中幸町**********', 'S14023', '20151126', '6-20100423-9')]"
" ('CS002503000087', '松居 ケンイチ', '0', '男性', datetime.date(1960, 5, 9), 58, '187-0021', '東京都小平市上水南町**********', 'S13002', '20160613', '0-00000000-0'),\n",
" ('CS029415000273', '本山 あい', '1', '女性', datetime.date(1973, 2, 16), 46, '279-0003', '千葉県浦安市海楽**********', 'S12029', '20160903', '0-00000000-0'),\n",
" ('CS008502000023', '臼井 貴嶺', '0', '男性', datetime.date(1962, 6, 30), 56, '213-0031', '神奈川県川崎市高津区宇奈根**********', 'S13008', '20150612', '0-00000000-0'),\n",
" ('CS040512000188', '久野 美紀', '1', '女性', datetime.date(1959, 4, 28), 59, '226-0027', '神奈川県横浜市緑区長津田**********', 'S14040', '20160203', '0-00000000-0'),\n",
" ('CS009513000178', '草野 恵梨香', '1', '女性', datetime.date(1965, 11, 5), 53, '158-0095', '東京都世田谷区瀬田**********', 'S13009', '20150524', 'C-20100808-9'),\n",
" ('CS024512000042', '平塚 奈月', '1', '女性', datetime.date(1959, 6, 4), 59, '216-0015', '神奈川県川崎市宮前区菅生**********', 'S14024', '20150702', '0-00000000-0'),\n",
" ('CS015614000010', '井田 真奈美', '1', '女性', datetime.date(1954, 6, 9), 64, '136-0076', '東京都江東区南砂**********', 'S13015', '20150516', '0-00000000-0'),\n",
" ('CS011312000090', '米沢 ヒカル', '1', '女性', datetime.date(1984, 12, 31), 34, '211-0066', '神奈川県川崎市中原区今井西町**********', 'S14011', '20141213', '0-00000000-0')]"
]
},
"execution_count": 79,
Expand Down Expand Up @@ -11862,9 +11861,9 @@
"text": [
" * postgresql://padawan:***@db:5432/dsdojo_db\n",
"Done.\n",
"1652 rows affected.\n",
"1705 rows affected.\n",
"Done.\n",
"20319 rows affected.\n"
"20266 rows affected.\n"
]
},
{
Expand Down Expand Up @@ -12153,7 +12152,7 @@
"text": [
" * postgresql://padawan:***@db:5432/dsdojo_db\n",
"Done.\n",
"16575 rows affected.\n"
"16543 rows affected.\n"
]
},
{
Expand Down Expand Up @@ -12234,7 +12233,7 @@
" </tr>\n",
" <tr>\n",
" <td>0</td>\n",
" <td>8269</td>\n",
" <td>8237</td>\n",
" </tr>\n",
" <tr>\n",
" <td>1</td>\n",
Expand All @@ -12243,7 +12242,7 @@
"</table>"
],
"text/plain": [
"[(0, 8269), (1, 8306)]"
"[(0, 8237), (1, 8306)]"
]
},
"execution_count": 104,
Expand Down

0 comments on commit 5c05332

Please sign in to comment.