In the database/sql package, what method is used to execute a SQL query that returns rows?
- Query
- Execute
- ExecuteQuery
- Fetch
The correct option is Query. In Go's database/sql package, the Query method is used to execute a SQL query that returns rows from the database. This method is commonly used for SELECT queries.
Loading...
Related Quiz
- Explain how slices are internally represented in Go.
- What is the primary purpose of unit tests in Go?
- The _______ statement in Go is used to execute a block of code based on the truth value of an expression.
- How can channels be used to synchronize Goroutines?
- What is a CRUD operation in database interaction?