Upgrade to Pro — share decks privately, control downloads, hide ads and more …

RubyとRailsの勉強のしかたとコミュニティの参加のしかた

 RubyとRailsの勉強のしかたとコミュニティの参加のしかた

初心者向けに作ったセミナーの資料

Shinichiro OGAWA

July 06, 2013
Tweet

More Decks by Shinichiro OGAWA

Other Decks in Technology

Transcript

  1. ࣗݾ঺հ w 3VCZ3BJMTྺ೥ w "GUFS3BJMTੈ୅ w 5PLZVSCڞಉઃཱऀ w ΫοΫύουͷΤϯδχΞ w

    3BJMTΤϯδχΞ w ͲͪΒ͔ͱݴ͑͹ίϛϡχςΟଆͷਓؒ 13೥7݄7೔೔༵೔
  2. ࣮͸࢖ΘΕ͍ͯΔ3VCZ w qVFOUE w ϝοηʔδʢϩάʣͷऩूαʔϏε w $IFG1VQQFU w αʔό؅ཧπʔϧ w

    $BQJTUSBOP w σϓϩΠπʔϧ w όοΫΤϯυπʔϧͱ༷ͯ͠ʑʹར༻͞Ε͍ͯΔ 13೥7݄7೔೔༵೔
  3. %3: %PO`U3FQFBU:PVSTFMG w ʮୡਓϓϩάϥϚʔʯͰத৺ͱͳΔݪଇ w ಉ͡ࣄΛ܁Γฦ͞ͳ͍ w ίϐϖ͠ͳ͍ w ಉ͡Α͏ͳॲཧ͸·ͱΊΔ

    w ద੾ͳϞδϡʔϧ΍Ϋϥεʹ੾Γग़͢ w ϝϯςφϯεੑΛ޲্ͤ͞Δ 13೥7݄7೔೔༵೔
  4. 3&45GVM w 3&QSFTFOUBUJPO4UBUF5SBOTGFS w 63*ΛϦιʔεͩͱߟ͑Δ w ϢʔβϦιʔε͸VTFST w 3&45GVMʹ࡞Δͱɺ63-͕εοΩϦ͢Δ w

    3BJMTͰ͸3&45GVMʹͭ͘Δͱɺ༨ܭͳઃఆΛ͠ ͳͯ͘΋ྑ͘ͳΔ 13೥7݄7೔೔༵೔
  5. 3&45GVM w 3&QSFTFOUBUJPO4UBUF5SBOTGFS w 63*ΛϦιʔεͩͱߟ͑Δ w ϢʔβϦιʔε͸VTFST w 3&45GVMʹ࡞Δͱɺ63-͕εοΩϦ͢Δ w

    3BJMTͰ͸3&45GVMʹͭ͘Δͱɺ༨ܭͳઃఆΛ͠ ͳͯ͘΋ྑ͘ͳΔ w $P$ͷݪଇ͕ಇ͍͍ͯΔ 13೥7݄7೔೔༵೔
  6. 3BJMTͷόʔδϣϯΞοϓ͸ ૣ͍ w ։ൃ͕ඇৗʹ׆ൃ w ৽ػೳ΍ઌਐతͳߟ͕͙͑͢ʹಋೖ͞ΕΔ w ৽͍͜͠ͱ͕͙͢ʹࢼ͞ΕΔ w ΤϯδχΞͱͯ͠͸ָ͍͠

    w ͦͷ൓໘ɺޓ׵ੑΛॏࢹ͍ͯ͠ͳ͍ w όʔδϣϯΞοϓͰ࢖͑ͳ͘ͳΔػೳ΋ଟ͍ 13೥7݄7೔೔༵೔
  7. 3BJMTͷόʔδϣϯΞοϓ͸ ૣ͍ w ։ൃ͕ඇৗʹ׆ൃ w ৽ػೳ΍ઌਐతͳߟ͕͙͑͢ʹಋೖ͞ΕΔ w ৽͍͜͠ͱ͕͙͢ʹࢼ͞ΕΔ w ΤϯδχΞͱͯ͠͸ָ͍͠

    w ͦͷ൓໘ɺޓ׵ੑΛॏࢹ͍ͯ͠ͳ͍ w όʔδϣϯΞοϓͰ࢖͑ͳ͘ͳΔػೳ΋ଟ͍ w ͲͪΒ͕͍͍͔͸Θ͔Βͳ͍ 13೥7݄7೔೔༵೔
  8. 3BJMTͷ͠͝ͱ w ΢ΣϒαʔϏεͰ։ൃΛߴ଎ʹߦ͏ͨΊʹ w ΫοΫύου w ৯΂ϩά w Β͘Β͘࿈བྷ໢ w

    QJYJWDPN w ΤϯδχΞ͕։ൃ͠΍͍͢ͷ͕ར఺ 13೥7݄7೔೔༵೔
  9. 3BJMTͰඞཁʹͳΔ஌ࣝ w 3VCZ͸΋ͪΖΜ͕ͩɺͦΕҎ֎ʹ΋݁ߏଟ͍ w (JU)5.- +BWB4DSJQU K2VFSZ.Z42-  1PTUHSF42-.POHP%# ,74-JOVY

    Ծ૝Խ ٕज़ αʔό؅ཧ1BB4 714 "NB[PO&$ Ϋ ϥ΢υ w 8FCΞϓϦέʔγϣϯΛ࡞Δ্Ͱඞཁͳ͜ͱ͕ جຊతʹ஌͍ͬͯΔඞཁ͕͋Δ 13೥7݄7೔೔༵೔
  10. 3BJMTͰඞཁʹͳΔ஌ࣝ w 3VCZ͸΋ͪΖΜ͕ͩɺͦΕҎ֎ʹ΋݁ߏଟ͍ w (JU)5.- +BWB4DSJQU K2VFSZ.Z42-  1PTUHSF42-.POHP%# ,74-JOVY

    Ծ૝Խ ٕज़ αʔό؅ཧ1BB4 714 "NB[PO&$ Ϋ ϥ΢υ w 8FCΞϓϦέʔγϣϯΛ࡞Δ্Ͱඞཁͳ͜ͱ͕ جຊతʹ஌͍ͬͯΔඞཁ͕͋Δ w ݁ߏଟ͘ଟذʹΘ͍ͨͬͯΔ 13೥7݄7೔೔༵೔
  11. 3BJMTͰඞཁʹͳΔ஌ࣝ w ཁ͢Δʹ w ΢ΣϒαʔϏεΛ։ൃɾӡӦ͢Δ্Ͱඞཁͳ ͜ͱ w 3BJMTΞϓϦέʔγϣϯΛ։ൃ͢Δ্Ͱඞཁ ͳ͜ͱ w

    ͜ΕΒ͸ಉ͘͡ඞཁʹͳΔ΋ͷ w ͲͷݴޠΛ࢖͍ͬͯͯ΋ඞཁʹͳΔΑ͏ͳ஌ࣝ 13೥7݄7೔೔༵೔
  12. K2VFSZ;FQUP w %0.ૢ࡞ͳͲΛ؆ུԽ͢ΔK2VFSZ w K2VFSZͷܰྔ൛Ͱ͋Δ;FQUP w $P⒎FF4DSJQUͱ૊Έ߹ΘͤΔͱ؆ܿʹॻ͚ Δ # jQuery

    + CoffeeScript $(‘#button’).bind(‘click’, -> alert(‘Button is clicked!’) ) 13೥7݄7೔೔༵೔
  13. .Z42-1PTUHSF42- w σʔλϕʔεαʔόιϑτͷಛ௃Λ஌͓͍ͬͯͨ΄͏ ͕ྑ͍ w ΠϯσοΫεͷ࢖͍ํ w ෛՙ෼ࢄͷ࢓ํ w ϨϓϦέʔγϣϯͳͲ

    w খن໛ͳΒ஌Βͳͯ͘΋ࠔΒͳ͍ w Կ͔͋ͬͨ࣌ʹʮ͋ɺ΋͔ͯ͠͠ʯͱࢥ͑ͨํ͕҆ ৺Ͱ͖Δ 13೥7݄7೔೔༵೔
  14. ,FZ7BMVF4UPSF w σʔλϕʔεͷҰछ w NFNDBDIFE w 5PLZP5ZSBOU,ZPUP$BCJOFU w 3FEJT w

    TBWFSFTUPSF͕ߴ଎ w Ωϟογϡ΍ςϯϙϥϦʹར༻ 13೥7݄7೔೔༵೔
  15. )FSPLV w 3VCZք۾Ͱ͸࠷΋Α͘஌ΒΕ͍ͯΔ w 3VCZ։ൃऀΛࣾһͱͯ͠ޏ͍ͬͯΔ w ࠷ۙ͸3VCZͷରԠ͕ྑ͘ͳ͖ͬͯͨ w ແྉͰ΋͋Δఔ౓࢖͑Δ w

    )FSPLV5PPMCFMU w 3VCZ3BJMT(JUͳͲ͕ҰׅΠϯετʔϧͰ͖Δ w ͱʹ͔͘Ұ౓΍͓ͬͯ͘ͱྑ͍ 13೥7݄7೔೔༵೔
  16. .PHPL w **+͕ఏڙ͢Δࠃ࢈1BB4 w 3VCZ3BJMT͕ಈ͘ w ೔ຊͷاۀ͕ఏڙ͍ͯ͠Δ w ͨͩ͋·ΓੵۃతͰ͸ͳ͍Α͏ʹݟ͑Δ w

    ͋Δఔ౓ͳΒແྉͰར༻Ͱ͖Δ w ͪ͜Β΋Ұ౓ࢼͯ͠Έ͓ͯ͘΂͖ 13೥7݄7೔೔༵೔
  17. &OHJOF:BSE w ๺ถͰ͸ׂͱݹ͔͘Β͋Δձࣾ w ٕज़ྗʹ͸ఆධ͕͋Δ w ࠷ۙ೔ຊࢢ৔ʹྗΛೖΕ͍ͯΔ w ೔ຊޠ৘ใ΋ॆ࣮͍ͯ͠Δ w

    3VCZ1)1OPEFKTʹରԠ w ແྉ͓ࢼ͠෼͕͋Δ w ͪ͜Β΋ࢼ͓͍ͯͯ͠ଛ͸ͳ͍ 13೥7݄7೔೔༵೔
  18. ࣮ࡍʹαʔϏεΛ ։ൃɾӡ༻͠ͳ͕Β w 714ΛआΓͯΈΔ w ԁ݄ҎԼͰͰ͖Δ w αʔόιϑτ΢ΣΞશ෦΍Βͳ͚Ε͹ͳΒͳ͍ ͕ɺͦͷ෼஌ࣝ͸਎ʹͭ͘ w

    )FSPLVΛແྉͰ࢖ͬͯΈΔ w ͋Δఔ౓͸Θ͔Δ͕ɺৄࡉͳઃఆ͸ෆ໌ͷ·· w ΞϓϦέʔγϣϯ։ൃʹूதͰ͖Δ 13೥7݄7೔೔༵೔
  19. ϒϩάͳͲ w ॻ੶Ҏ֎͸΍͸ΓϒϩάͳͲ w ྫ͑͹͸ͯͳΩʔϫʔυ w IUUQLIBUFOBOFKQLFZXPSECMPH3VCZ w IUUQLIBUFOBOFKQLFZXPSECMPH3BJMT w

    ఆ൪ա͗Δ͕݁ߏ৘ใ͕ू·ͬͯΔ w ͍͍هࣄ͕͋Ε͹ͲΜͲΜߪಡͯ͠ΈΔ 13೥7݄7೔೔༵೔
  20. ϒϩάͳͲ w ॻ੶Ҏ֎͸΍͸ΓϒϩάͳͲ w ྫ͑͹͸ͯͳΩʔϫʔυ w IUUQLIBUFOBOFKQLFZXPSECMPH3VCZ w IUUQLIBUFOBOFKQLFZXPSECMPH3BJMT w

    ఆ൪ա͗Δ͕݁ߏ৘ใ͕ू·ͬͯΔ w ͍͍هࣄ͕͋Ε͹ͲΜͲΜߪಡͯ͠ΈΔ w ͬ͟ͱಡΉ͚ͩͰ΋ɺهԱʹ࢒Δ 13೥7݄7೔೔༵೔
  21. 3BJMT$BTU3VCZ w IUUQSBJMTDBTUTDPN w 3BJMT΍ϓϥάΠϯͷ࢖͍ํΛ঺հ͢Δ 1PEDBTU w ͨͩݱࡏ͸ߋ৽ఀࢭத w ʹ৽͘͠ͳΔ༧ఆ

    w IUUQSVCZFOWZMBCTDPN w 3BJMTͱ3VCZͷ࠷৽৘ใΛ঺հ͢Δ1PEDBTU 13೥7݄7೔೔༵೔
  22. 3BJMTΒ͍͠ίʔυΛॻ͘ w·ͣ࠷ॳʹSBJMTίϚϯυΛ࢖͏ # ·ͣ͸scaffoldΛ࢖͏ $ rails g scaffold User #

    ίϯτϩʔϥΛ࡞Δ $ rails g controller Top index 13೥7݄7೔೔༵೔
  23. 3BJMTΒ͍͠ίʔυΛॻ͘ w·ͣ࠷ॳʹSBJMTίϚϯυΛ࢖͏ # ·ͣ͸scaffoldΛ࢖͏ $ rails g scaffold User #

    ίϯτϩʔϥΛ࡞Δ $ rails g controller Top index # ϞσϧΛ࡞Δ 13೥7݄7೔೔༵೔
  24. 3BJMTΒ͍͠ίʔυΛॻ͘ w·ͣ࠷ॳʹSBJMTίϚϯυΛ࢖͏ # ·ͣ͸scaffoldΛ࢖͏ $ rails g scaffold User #

    ίϯτϩʔϥΛ࡞Δ $ rails g controller Top index # ϞσϧΛ࡞Δ $ rails g model Blog name:string user_id:integer 13೥7݄7೔೔༵೔
  25. 3BJMTΒ͍͠ίʔυΛॻ͘ w·ͣ࠷ॳʹSBJMTίϚϯυΛ࢖͏ # ·ͣ͸scaffoldΛ࢖͏ $ rails g scaffold User #

    ίϯτϩʔϥΛ࡞Δ $ rails g controller Top index # ϞσϧΛ࡞Δ $ rails g model Blog name:string user_id:integer # ϞσϧʹΧϥϜΛ௥Ճ͢ΔϚΠάϨʔγϣϯΛ࡞Δ 13೥7݄7೔೔༵೔
  26. 3BJMTΒ͍͠ίʔυΛॻ͘ w·ͣ࠷ॳʹSBJMTίϚϯυΛ࢖͏ # ·ͣ͸scaffoldΛ࢖͏ $ rails g scaffold User #

    ίϯτϩʔϥΛ࡞Δ $ rails g controller Top index # ϞσϧΛ࡞Δ $ rails g model Blog name:string user_id:integer # ϞσϧʹΧϥϜΛ௥Ճ͢ΔϚΠάϨʔγϣϯΛ࡞Δ $ rails g migration AddAdminFlagToUsers 13೥7݄7೔೔༵೔
  27. 3BJMTΒ͍͠ίʔυΛॻ͘ w ෳࡶͳ͜ͱ͸͠ͳ͍ w ෳࡶͳॲཧΛ͠ͳ͍ͱ͍͏͜ͱͰ͸ͳ͍ w Ϩʔϧ͔Β֎Εͳ͍ w "DUJWF3FDPSEͰ42-Λ௚઀ॻ͔ͳ͍ #

    SQLͰߟ͑ͯॻ͘ͱ User.find_by_sql(‘SELECT * FROM users WHERE user_id IN (1, 2, 3, ...) AND ...’) 13೥7݄7೔೔༵೔
  28. 3BJMTΒ͍͠ίʔυΛॻ͘ w ෳࡶͳ͜ͱ͸͠ͳ͍ w ෳࡶͳॲཧΛ͠ͳ͍ͱ͍͏͜ͱͰ͸ͳ͍ w Ϩʔϧ͔Β֎Εͳ͍ w "DUJWF3FDPSEͰ42-Λ௚઀ॻ͔ͳ͍ #

    SQLͰߟ͑ͯॻ͘ͱ User.find_by_sql(‘SELECT * FROM users WHERE user_id IN (1, 2, 3, ...) AND ...’) # ϞσϧΛҙࣝͯ͠ॻ͘ͱ 13೥7݄7೔೔༵೔
  29. 3BJMTΒ͍͠ίʔυΛॻ͘ w ෳࡶͳ͜ͱ͸͠ͳ͍ w ෳࡶͳॲཧΛ͠ͳ͍ͱ͍͏͜ͱͰ͸ͳ͍ w Ϩʔϧ͔Β֎Εͳ͍ w "DUJWF3FDPSEͰ42-Λ௚઀ॻ͔ͳ͍ #

    SQLͰߟ͑ͯॻ͘ͱ User.find_by_sql(‘SELECT * FROM users WHERE user_id IN (1, 2, 3, ...) AND ...’) # ϞσϧΛҙࣝͯ͠ॻ͘ͱ User.where(id: [1, 2,..]).where(‘age > 30’).where(...) 13೥7݄7೔೔༵೔
  30. 3BJMTΒ͍͠ίʔυΛॻ͘ w ࣗલͰॲཧΛॻ͔ͳ͍ w 3BJMTͰ༻ҙ͞Ε͍ͯΔ΋ͷΛ࢖͏ w Α͘ར༻͞Ε͍ͯΔϓϥάΠϯΛ࢖͏ w ྑ͍ϓϥάΠϯ͸Ϩʔϧͷ৐͍ͬͯΔ w

    ͭ·ΓϨʔϧʹ৐Γଓ͚ΒΕΔՄೳੑ͕ߴ͍ w ࣗલͷॲཧ͸Ϩʔϧ͔Β֎Ε͍ͯΔ͔΋͠Εͳ͍ 13೥7݄7೔೔༵೔
  31. 3BJMTΒ͍͠ίʔυΛॻ͘ w ࣗલͰॲཧΛॻ͔ͳ͍ w 3BJMTͰ༻ҙ͞Ε͍ͯΔ΋ͷΛ࢖͏ w Α͘ར༻͞Ε͍ͯΔϓϥάΠϯΛ࢖͏ w ྑ͍ϓϥάΠϯ͸Ϩʔϧͷ৐͍ͬͯΔ w

    ͭ·ΓϨʔϧʹ৐Γଓ͚ΒΕΔՄೳੑ͕ߴ͍ w ࣗલͷॲཧ͸Ϩʔϧ͔Β֎Ε͍ͯΔ͔΋͠Εͳ͍ w ؾ͕ͭ͘ͱ3BJMT͔Β͔ͳΓ཭Εͨ΋ͷʹͳΓ ͔Ͷͳ͍ 13೥7݄7೔೔༵೔
  32. 3BJMTΒ͍͠ίʔυΛॻ͘ w Ϩʔϧ͔Β཭ΕΔͱԿ͕ྑ͘ͳ͍ͷ͔ w 3BJMTͷόʔδϣϯΞοϓʹ௥ैͰ͖ͳ͍ w ʮചΓ͖ΓͷҊ͔݅ͩΒʯ w ʮϝϯςφϯε͔͠͠ͳ͍Αʁʯ w

    ෆ۩߹मਖ਼΍ͪΐͬͱͨ͠มߋʹऑ͘ͳͬ ͯ͠·͏ w ৽͍͠ɺศརͳϓϥάΠϯΛར༻Ͱ͖ͳ͘ͳΔ 13೥7݄7೔೔༵೔
  33. 3BJMTΒ͍͠ίʔυΛॻ͘ w Ϩʔϧ͔Β཭ΕΔͱԿ͕ྑ͘ͳ͍ͷ͔ w 3BJMTͷόʔδϣϯΞοϓʹ௥ैͰ͖ͳ͍ w ʮചΓ͖ΓͷҊ͔݅ͩΒʯ w ʮϝϯςφϯε͔͠͠ͳ͍Αʁʯ w

    ෆ۩߹मਖ਼΍ͪΐͬͱͨ͠มߋʹऑ͘ͳͬ ͯ͠·͏ w ৽͍͠ɺศརͳϓϥάΠϯΛར༻Ͱ͖ͳ͘ͳΔ w ͋ͱͰ௥Ճ͠Α͏ͱͯ͠΋ແཧʹͳΔ 13೥7݄7೔೔༵೔
  34. 3BJMTΒ͍͠ઃܭʹ͢Δ w 3BJMTͷࢥ૝ʹͦͬͨઃܭʹ͢Δ w 3&45GVMʹ͢Δ w 63-ઃܭ͸͔ͳΓॏཁ w Ϧιʔεͱ͍͏֓೦Λલ໘ʹग़͢ #

    ϢʔβͷϦιʔεΛऔಘ GET /users/1234 # ϢʔβͷϦιʔεΛߋ৽ PUT /users/1234 13೥7݄7೔೔༵೔
  35. 3BJMTΒ͍͠ઃܭʹ͢Δ w ʮϢʔβͱϒϩάͷؔ࿈ʯ΋ن໿Ͳ͓Γʹ࡞Δ w SBJMTHίϚϯυͰ࡞Δ $ rails g model User

    name:string $ rails g model Blog title:string user:references 13೥7݄7೔೔༵೔
  36. 3BJMTΒ͍͠ઃܭʹ͢Δ w ʮϢʔβͱϒϩάͷؔ࿈ʯ΋ن໿Ͳ͓Γʹ࡞Δ w SBJMTHίϚϯυͰ࡞Δ $ rails g model User

    name:string $ rails g model Blog title:string user:references CREATE TABLE users ( 13೥7݄7೔೔༵೔
  37. 3BJMTΒ͍͠ઃܭʹ͢Δ w ʮϢʔβͱϒϩάͷؔ࿈ʯ΋ن໿Ͳ͓Γʹ࡞Δ w SBJMTHίϚϯυͰ࡞Δ $ rails g model User

    name:string $ rails g model Blog title:string user:references CREATE TABLE users ( id INTEGER, name VARCHAR(255) 13೥7݄7೔೔༵೔
  38. 3BJMTΒ͍͠ઃܭʹ͢Δ w ʮϢʔβͱϒϩάͷؔ࿈ʯ΋ن໿Ͳ͓Γʹ࡞Δ w SBJMTHίϚϯυͰ࡞Δ $ rails g model User

    name:string $ rails g model Blog title:string user:references CREATE TABLE users ( id INTEGER, name VARCHAR(255) ); 13೥7݄7೔೔༵೔
  39. 3BJMTΒ͍͠ઃܭʹ͢Δ w ʮϢʔβͱϒϩάͷؔ࿈ʯ΋ن໿Ͳ͓Γʹ࡞Δ w SBJMTHίϚϯυͰ࡞Δ $ rails g model User

    name:string $ rails g model Blog title:string user:references CREATE TABLE users ( id INTEGER, name VARCHAR(255) ); CREATE TABLE blogs ( 13೥7݄7೔೔༵೔
  40. 3BJMTΒ͍͠ઃܭʹ͢Δ w ʮϢʔβͱϒϩάͷؔ࿈ʯ΋ن໿Ͳ͓Γʹ࡞Δ w SBJMTHίϚϯυͰ࡞Δ $ rails g model User

    name:string $ rails g model Blog title:string user:references CREATE TABLE users ( id INTEGER, name VARCHAR(255) ); CREATE TABLE blogs ( id INTEGER, title VARCHAR(255), user_id INTEGER 13೥7݄7೔೔༵೔
  41. 3BJMTΒ͍͠ઃܭʹ͢Δ w ʮϢʔβͱϒϩάͷؔ࿈ʯ΋ن໿Ͳ͓Γʹ࡞Δ w SBJMTHίϚϯυͰ࡞Δ $ rails g model User

    name:string $ rails g model Blog title:string user:references CREATE TABLE users ( id INTEGER, name VARCHAR(255) ); CREATE TABLE blogs ( id INTEGER, title VARCHAR(255), user_id INTEGER ); 13೥7݄7೔೔༵೔
  42. 3BJMTΒ͍͠ઃܭʹ͢Δ w ʮϢʔβͱϒϩάͷؔ࿈ʯ΋ن໿Ͳ͓Γʹ࡞Δ w SBJMTHίϚϯυͰ࡞Δ $ rails g model User

    name:string $ rails g model Blog title:string user:references CREATE TABLE users ( id INTEGER, name VARCHAR(255) ); CREATE TABLE blogs ( id INTEGER, title VARCHAR(255), user_id INTEGER ); # গ͠ʢ2ߦʣઃఆΛ௥Ճ͢Δ 13೥7݄7೔೔༵೔
  43. 3BJMTΒ͍͠ઃܭʹ͢Δ w ʮϢʔβͱϒϩάͷؔ࿈ʯ΋ن໿Ͳ͓Γʹ࡞Δ w SBJMTHίϚϯυͰ࡞Δ $ rails g model User

    name:string $ rails g model Blog title:string user:references CREATE TABLE users ( id INTEGER, name VARCHAR(255) ); CREATE TABLE blogs ( id INTEGER, title VARCHAR(255), user_id INTEGER ); # গ͠ʢ2ߦʣઃఆΛ௥Ճ͢Δ > user.blogs 13೥7݄7೔೔༵೔
  44. 3BJMTΒ͍͠ઃܭʹ͢Δ w $P$ʢઃఆΑΓن໿ʣͷݪଇʹै͏ w ै͍ͬͯΔͱίʔυྔ͕গͳ͘ͳΔ w ઃఆΛॻ͔ͳͯ͘΋Α͍͔Β w ϏδωεϩδοΫΛॻ͘ͳͱݴ͏͜ͱ Ͱ͸ͳ͍

    w ʮઃఆ͠ͳ͍ͱʯͱࢥͬͨΒةͳ͍αΠϯ w ΋ͪΖΜϓϥάΠϯͷઃఆ͸͋ͬͨΓ͢Δͷ Ͱɺ׬શʹͳ͘ͳΔΘ͚Ͱ͸ͳ͍ 13೥7݄7೔೔༵೔
  45. 3BJMTΒ͘͠։ൃ͢Δ w ʮςετͬͯͲ͏ॻ͘ͷʁʯ w Ϟσϧͷςετ͸࢓༷ςετ w Ϟσϧͷϝιου͸Ͳ͏ಈ͘ͷ͕ਖ਼͍͠ʁ w Ͳ͏ʮࣦഊ͢Δʯͷ͕ਖ਼͍͠ʁ w

    ͲΜͳͱ͖ʹʮΤϥʔʯʹͳͬͯ΄͠ ͍ʁ w ͜Μͳײ͡Ͱ࢓༷Λ֬ೝ͢ΔςετΛॻ͘ 13೥7݄7೔೔༵೔
  46. 3BJMTΒ͘͠։ൃ͢Δ w όʔδϣϯΛ؅ཧ͢Δ w (JU4VCWFSTJPO.FSDVSJBM w සൟʹίϛοτ͢Δ w ʮมߋͨ͠ʯͱ͍͏ཤྺΛอଘ͓ͯ͘͠ w

    ҰਓͰ΍ͬͯͯ΋ॏཁ w ྫ͑͹(JU)VCͩͬͨΓɺCJUCVDLFUͩͬͨΓ w ʮཤྺΛ࢒͢ʯ͜ͱΛ֮͑·͠ΐ͏ 13೥7݄7೔೔༵೔
  47. 3BJMTΒ͘͠։ൃ͢Δ w ίʔυϨϏϡʔͬͯʁ w ֬ೝΛ͢Δ w ίʔσΟϯάن໿ʹ͍ͦͬͯΔ͔ w ΍Γ͍ͨͱࢥͬͨ͜ͱ͕Ͱ͖͍ͯΔ͔ w

    ଞʹ෭࡞༻Λٴ΅͞ͳ͍͔ w ίʔυΛධՁ͢Δ w ͍͍ίʔυʹ͸  ΠΠͶ ͢Δ 13೥7݄7೔೔༵೔
  48. 3BJMTΒ͘͠։ൃ͢Δ w ίʔυϨϏϡʔͬͯʁ w ֬ೝΛ͢Δ w ίʔσΟϯάن໿ʹ͍ͦͬͯΔ͔ w ΍Γ͍ͨͱࢥͬͨ͜ͱ͕Ͱ͖͍ͯΔ͔ w

    ଞʹ෭࡞༻Λٴ΅͞ͳ͍͔ w ίʔυΛධՁ͢Δ w ͍͍ίʔυʹ͸  ΠΠͶ ͢Δ w ίʔυͷྑ͞ΛධՁ͢Δ 13೥7݄7೔೔༵೔
  49. 3JEFPO3BJMT w 3BJMTΒ͍͠ઃܭΛͯ͠ w 3BJMTΒ͍͠ίʔυΛॻ͍ͯ w 3BJMTΒ͍͠։ൃΛଓ͚Δ w ָ͘͠3BJMTͰ։ൃΛ͢Δ͜ͱ͕Ͱ͖Δ w

    ͞ΒʹΑ͍ઃܭ͕Ͱ͖ͯ w Α͍ίʔυ͕ॻ͚ͯ w ྑ͍॥؀͕ੜΈग़͞ΕΔ 13೥7݄7೔೔༵೔