require"sqlite3"# Open a databasedb=SQLite3::Database.new"test.db"# Create a databaserows=db.execute<<-SQL
create table numbers (
name varchar(30),
val int
);
SQL# Execute a few inserts{"one"=>1,"two"=>2,}.eachdo|pair|db.execute"insert into numbers values ( ?, ? )",pairend# Execute inserts with parameter markersdb.execute("INSERT INTO students (name, email, grade, blog)
VALUES (?, ?, ?, ?)",[@name,@email,@grade,@blog])# Find a few rowsdb.execute("select * from numbers")do|row|prowend