The _______ method in the database/sql package is used to execute a SQL query that returns rows.
- Exec
- QueryRow
- Query
- Execute
The correct option is "Query". The Query method is used to execute a SQL query that returns rows. It prepares the SQL statement and then executes it, returning a Rows result set for further processing.
Loading...
Related Quiz
- Explain the concept of "zero values" in Go. Provide examples for different data types.
- You have a slice of integers in Go, and you want to remove the element at index 3. How would you achieve this while maintaining the order of the remaining elements?
- The primary purpose of mocking is to verify the _______ between different parts of a system.
- In OAuth, the _______ role is responsible for authorizing access to protected resources.
- What keyword is used to specify a condition in a switch statement in Go?