Kuis terkait panduan · Sedang Tingkat
Cara Menulis Kueri SQL dengan Kuis AI
Uji seberapa baik Anda dapat memberikan skema Anda kepada AI, menangkap fan-out gabungan dan jebakan NULL, dan memverifikasi SQL yang dihasilkan AI dengan aman sebelum memercayai hasilnya.
Pertanyaan 1 dari 8
Menurut panduan ini, langkah apa yang paling meningkatkan akurasi SQL yang dihasilkan AI?
Pratinjau setiap pertanyaan8 pertanyaan
Jawaban dan penjelasan muncul saat Anda mengikuti kuis.
- Menurut panduan ini, langkah apa yang paling meningkatkan akurasi SQL yang dihasilkan AI?
- Asking the model to be extra careful
- Pasting your schema, such as CREATE TABLE statements and relationships
- Writing your question entirely in uppercase
- Always using the newest model available
- Mengapa Anda harus memberi tahu AI dialek SQL mana yang Anda gunakan?
- Only PostgreSQL supports SELECT statements
- AI models refuse to answer without a dialect
- The dialect determines how much disk space a query uses
- Dialects differ in details like date functions and LIMIT versus TOP
- Anda menggabungkan pesanan ke order_items dan kemudian menghitung SUM(orders.total). Apa kemungkinan masalahnya?
- Revenue is inflated because each order total repeats once per item
- The query will always fail with a syntax error
- NULL values are converted to zero
- The results come back sorted in the wrong order
- Mengapa panduan ini merekomendasikan meminta AI untuk menjelaskan pertanyaannya dengan kata-kata yang sederhana?
- It makes the query run faster
- SQL engines require an explanation before executing
- It exposes misunderstandings, such as counting rows instead of distinct customers
- It reduces the cost of the AI request
- Pernyataan manakah tentang COUNT(kolom) dan COUNT(*) yang benar?
- They always return the same number
- COUNT(column) skips NULLs, while COUNT(*) counts every row
- COUNT(*) skips NULLs, while COUNT(column) counts every row
- COUNT(column) counts only distinct values
- What is the safest way to experiment with AI-generated queries?
- Run them directly on production during quiet hours
- Ask the AI whether the query is safe and trust the answer
- Use a read-only database user and wrap data changes in a transaction you can roll back
- Remove the WHERE clause so the query is simpler
- When asking an AI to optimize a slow query, what should you provide besides the query?
- A screenshot of the dashboard that uses it
- The database password
- A list of everyone who runs the report
- The execution plan from EXPLAIN or EXPLAIN ANALYZE
- Which of these is a misconception the guide warns against?
- A query that runs without errors must be returning the right answer
- The schema alone is often enough context, without real customer data
- An UPDATE without a WHERE clause affects every row
- Business rules like amounts stored in cents should be stated