id integer NOT NULL AUTO_INCREMENT, name varchar(128) NOT NULL, PRIMARY KEY (id) )`) sqlInsert := `INSERT INTO people (id, name) VALUES (?, ?)` db.Exec(sqlInsert, 1, "Alice") db.Exec(sqlInsert, 2, "Bob") db.Exec(sqlInsert, 3, "Carol") rows, _ := db.Query(`SELECT id, name FROM people`) defer rows.Close() for rows.Next() { var id int var name string rows.Scan(&id, &name) fmt.Println(id, name) }