The _______ method in the database/sql package is used to execute a SQL query that returns rows.
- Exec
- Query
- Prepare
- Close
The correct option is Query. The Query method in database/sql package is used to execute a SQL query that returns rows. This method is used when you expect rows to be returned from the query execution.
Loading...
Related Quiz
- In Go, if the type assertion is false and only one value is being returned, a ___ will occur.
- What are some common use cases for middleware in Go web applications?
- _______ is a metric that indicates the percentage of lines of code executed by the test suite.
- In Go, what is the purpose of the 'testing' package?
- What is the use of the 'new' keyword in Go?