# Database/SQL (Go) > database/sql paketiyle Go'da SQL veritabanı erişiminde ustalaşın: bağlantılar, sorgular, transaction'lar, prepared statement'lar ve connection pool yönetimi. - 22 mülakat soruları - Mid-Level - [Mülakat Soruları: Go](https://sharpskill.dev/tr/technologies/go/mulakat-sorulari.md) ## 1. DB.Query ile DB.Exec arasındaki temel fark nedir? **Cevap** DB.Query, veri satırları döndüren SELECT sorgularını çalıştırmak için kullanılırken, DB.Exec sonuç döndürmeyen SQL komutlarını (INSERT, UPDATE, DELETE) çalıştırmak içindir. Query, üzerinde yineleme yapılması ve rows.Close() ile kapatılması gereken bir Rows nesnesi döndürür; Exec ise etkilenen satır sayısını ve son eklenen ID'yi içeren bir Result döndürür. ## 2. Bir sorgudan sonra Rows nesnesini kapatmak neden önemlidir? **Cevap** Rows'u rows.Close() ile kapatmak, database bağlantısının kaynaklarını serbest bırakır ve bağlantının pool'a geri dönmesini sağlar. Kapatılmazsa bağlantılar meşgul kalır ve pool tükenebilir, bu da tıkanmalara yol açar. Sonradan bir hata oluşsa bile kapatmayı garanti etmek için Query hatasını kontrol ettikten hemen sonra defer rows.Close() kullanılması önerilir. ## 3. Tek bir sonuç satırını almak için hangi yöntem kullanılmalıdır? **Cevap** DB.QueryRow özellikle tek bir satırı almak için tasarlanmıştır ve bir Row nesnesi (tekil) döndürür. Rows döndüren ve rows.Next() ile yineleme gerektiren Query'nin aksine, QueryRow doğrudan scan yapmaya izin vererek kodu basitleştirir. Hata işleme Scan sırasında gerçekleşir; burada sql.ErrNoRows hiçbir satır bulunamadığını gösterir. ## 19 soru daha mevcut - database/sql ile bir veritabanına bağlantı nasıl açılır? - rows.Scan() yöntemi ne döndürür? Ücretsiz kaydol: https://sharpskill.dev/tr/login ## Diğer Go mülakat konuları - [Go Temelleri](https://sharpskill.dev/tr/technologies/go/mulakat-sorulari/go-basics.md): 25 soru, Junior - [Go Veri Yapıları](https://sharpskill.dev/tr/technologies/go/mulakat-sorulari/go-data-structures.md): 20 soru, Junior - [Go Arayüzleri](https://sharpskill.dev/tr/technologies/go/mulakat-sorulari/go-interfaces.md): 18 soru, Junior - [Hata Yönetimi](https://sharpskill.dev/tr/technologies/go/mulakat-sorulari/error-handling.md): 20 soru, Junior - [Goroutine Temelleri](https://sharpskill.dev/tr/technologies/go/mulakat-sorulari/goroutines-basics.md): 20 soru, Junior - [Channels](https://sharpskill.dev/tr/technologies/go/mulakat-sorulari/channels.md): 22 soru, Junior - [Go Modules](https://sharpskill.dev/tr/technologies/go/mulakat-sorulari/go-modules.md): 18 soru, Mid-Level - [HTTP Sunucusu](https://sharpskill.dev/tr/technologies/go/mulakat-sorulari/http-server.md): 24 soru, Mid-Level - [HTTP İstemcisi](https://sharpskill.dev/tr/technologies/go/mulakat-sorulari/http-client.md): 18 soru, Mid-Level - [JSON Kodlama](https://sharpskill.dev/tr/technologies/go/mulakat-sorulari/json-encoding.md): 20 soru, Mid-Level - [context Paketi](https://sharpskill.dev/tr/technologies/go/mulakat-sorulari/context-package.md): 20 soru, Mid-Level - [Testing](https://sharpskill.dev/tr/technologies/go/mulakat-sorulari/testing.md): 22 soru, Mid-Level - [Eşzamanlılık Desenleri](https://sharpskill.dev/tr/technologies/go/mulakat-sorulari/concurrency-patterns.md): 24 soru, Mid-Level - [Senkronizasyon İlkelleri](https://sharpskill.dev/tr/technologies/go/mulakat-sorulari/sync-primitives.md): 22 soru, Mid-Level - [Go Web Framework'leri](https://sharpskill.dev/tr/technologies/go/mulakat-sorulari/go-web-frameworks.md): 20 soru, Mid-Level - [REST API Tasarımı](https://sharpskill.dev/tr/technologies/go/mulakat-sorulari/rest-api-design.md): 20 soru, Mid-Level - [gRPC](https://sharpskill.dev/tr/technologies/go/mulakat-sorulari/grpc.md): 22 soru, Mid-Level - [Reflection](https://sharpskill.dev/tr/technologies/go/mulakat-sorulari/reflection.md): 20 soru, Senior - [Bellek Yönetimi](https://sharpskill.dev/tr/technologies/go/mulakat-sorulari/memory-management.md): 24 soru, Senior - [Performans Optimizasyonu](https://sharpskill.dev/tr/technologies/go/mulakat-sorulari/performance-optimization.md): 22 soru, Senior - [Generics](https://sharpskill.dev/tr/technologies/go/mulakat-sorulari/generics.md): 20 soru, Senior - [Go Design Patterns](https://sharpskill.dev/tr/technologies/go/mulakat-sorulari/design-patterns.md): 24 soru, Senior - [Microservices](https://sharpskill.dev/tr/technologies/go/mulakat-sorulari/microservices.md): 24 soru, Senior - [Güvenlik ve Kimlik Doğrulama](https://sharpskill.dev/tr/technologies/go/mulakat-sorulari/security-authentication.md): 24 soru, Senior - [Docker & Containerization](https://sharpskill.dev/tr/technologies/go/mulakat-sorulari/docker-containerization.md): 20 soru, Senior - [Kubernetes Basics](https://sharpskill.dev/tr/technologies/go/mulakat-sorulari/kubernetes-basics.md): 22 soru, Senior - [İleri Düzey Go](https://sharpskill.dev/tr/technologies/go/mulakat-sorulari/advanced-go.md): 20 soru, Senior - [CLI Geliştirme](https://sharpskill.dev/tr/technologies/go/mulakat-sorulari/cli-development.md): 20 soru, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/tr/technologies/go/mulakat-sorulari/database-sql