Senior
What databases have you worked with? Through ORM or native queries? What native queries did you write and at what level?
sobes.tech AI
Answer from AI
Worked with various databases: PostgreSQL, MySQL, MongoDB, Redis. Mainly used ORM (e.g., GORM for Go) to speed up development and convenience, but for complex queries and optimization, wrote native SQL queries.
Examples of native queries:
- Complex JOINs with aggregations and subqueries
- Use of window functions
- Optimized queries using indexes and filters
Level — confident in SQL, including writing complex queries, optimization, and understanding execution plans. In Go, used the database/sql package and sqlx for ease of working with native queries.
Example of a native query in Go using database/sql:
query := `SELECT id, name FROM users WHERE age > $1 ORDER BY created_at DESC LIMIT 10`
rows, err := db.Query(query, 30)
if err != nil {
log.Fatal(err)
}
// process rows
Using ORM allows for quick start, but for performance-critical sections, I always prefer native queries.