æ¨æ¥ã¯éä¸ã§ç ã£ã¡ãã£ãã®ã§ãä»åãç´ããä»æ¥ã¯ãã¼ãã«ã®ä½æ(CREATE TABLE)ãã¬ã³ã¼ãã®æ¿å ¥(INSERT)ãããã«SELECTãå®è¡ãã¾ãããããããã©ã³ã¶ã¯ã·ã§ã³ãã 1. ãã¼ãã«ã®ä½æ(init.rb) CREATE TABLEã使ã£ã¦peopleã¨ãããã¼ãã«ãä½ãã¾ããrubyco.dbã¨ãããã¡ã¤ã«ãä½ããã¾ãã # init.rb require 'sqlite3' sql = <<'EOD' CREATE TABLE people ( id TEXT PRIMARY KEY ,name TEXT ,mail TEXT ,age INTEGER ); EOD db = SQLite3::Database.new('rubyco.db') db.execute_batch(sql) 2. ã¬ã³ã¼ãã®æ¿å ¥(create1.rb) SQLite3::Database
{{#tags}}- {{label}}
{{/tags}}