// Example 1: simple query stmt, err := db.Prepare("SELECT * FROM users WHERE id = ?") if err != nil { log.Fatal(err) } rows, err := stmt.Query(1) defer rows.Close() for rows.Next() { // do something with each row } // Example 2: update statement stmt, err := db.Prepare("UPDATE users SET password = ? WHERE id = ?") if err != nil { log.Fatal(err) } result, err := stmt.Exec("newpassword", 1) if err != nil { log.Fatal(err) } rowsAffected, err := result.RowsAffected()In the first example, we use a Stmt to prepare a SELECT query with a placeholder for the ID value. We then execute the query with `stmt.Query(1)` and iterate over the result set. In the second example, we use a Stmt to prepare an UPDATE statement with placeholders for the new password value and the ID of the user to update. We then execute the update with `stmt.Exec("newpassword", 1)` and check the number of rows affected with `result.RowsAffected()`. The package library for database/sql is, unsurprisingly, the "database/sql" package in the standard library.