Aggregate
BigQuery
STDDEV
Calculates the sample standard deviation of numeric values. Measures how spread out the data is from its mean. An alias for STDDEV_SAMP.
Tipe hasil:
FLOAT64Diperbarui: 13 Jun 2026Syntax
SQL
STDDEV(expression)Parameter
expressionnumericwajib
The numeric column or expression to compute the standard deviation for
Contoh Penggunaan
Standard Deviation of Prices
SQL
1 SELECT 2 product_category, 3 AVG(price) as avg_price, 4 STDDEV(price) as price_stddev, 5 MIN(price) as min_price, 6 MAX(price) as max_price 7 FROM `project.dataset.products` 8 GROUP BY product_category;
Analyzes price variability per product category.
Hasil
| product_category | avg_price | price_stddev | min_price | max_price |
|---|---|---|---|---|
| Electronics | 2500000 | 1850000 | 99000 | 25000000 |
| Fashion | 450000 | 320000 | 50000 | 5000000 |
Response Time Variability
SQL
1 SELECT 2 endpoint, 3 AVG(response_time_ms) as avg_response, 4 STDDEV(response_time_ms) as stddev_response, 5 STDDEV(response_time_ms) / AVG(response_time_ms) as coefficient_of_variation 6 FROM `project.dataset.api_logs` 7 WHERE DATE(timestamp) = CURRENT_DATE() 8 GROUP BY endpoint 9 ORDER BY coefficient_of_variation DESC;
Identifies endpoints with unstable response times.
Hasil
| endpoint | avg_response | stddev_response | coefficient_of_variation |
|---|---|---|---|
| /api/search | 250 | 450 | 1.80 |
| /api/user | 50 | 25 | 0.50 |
| /api/health | 10 | 2 | 0.20 |
Salary Distribution Analysis
SQL
1 SELECT 2 department, 3 COUNT(*) as employee_count, 4 AVG(salary) as avg_salary, 5 STDDEV(salary) as salary_stddev, 6 STDDEV(salary) / AVG(salary) * 100 as variability_pct 7 FROM `project.dataset.employees` 8 GROUP BY department 9 HAVING COUNT(*) >= 5 10 ORDER BY variability_pct DESC;
Analyzes salary equity per department.
Hasil
| department | employee_count | avg_salary | salary_stddev | variability_pct |
|---|---|---|---|---|
| Sales | 45 | 12000000 | 4800000 | 40.0 |
| Engineering | 62 | 18000000 | 5400000 | 30.0 |
| Operations | 38 | 9500000 | 1900000 | 20.0 |
Pertanyaan Umum tentang STDDEV
Apa itu fungsi STDDEV di BigQuery?
Calculates the sample standard deviation of numeric values. Measures how spread out the data is from its mean. An alias for STDDEV_SAMP. Di BigQuery, fungsi STDDEV termasuk dalam kelompok fungsi yang sering digunakan untuk mengolah dan menganalisis data secara efisien.
Bagaimana cara menggunakan STDDEV di BigQuery?
Gunakan sintaks berikut: STDDEV(expression). Pastikan argumen yang dimasukkan sudah sesuai dengan tipe data yang diharapkan.
Apa nilai yang dikembalikan oleh fungsi STDDEV?
Fungsi STDDEV mengembalikan nilai bertipe FLOAT64. Pastikan tipe data hasil sudah sesuai dengan kebutuhan query atau formula kamu. Jika input mengandung nilai NULL, perilaku fungsi dapat berbeda — selalu periksa dokumentasi untuk memastikan hasilnya sesuai ekspektasi.
Apa saja parameter fungsi STDDEV?
Fungsi ini memiliki 1 parameter wajib. Parameter yang digunakan: expression (numeric, wajib): The numeric column or expression to compute the standard deviation for.
Ngulik Langsung
Latihan Langsung →Sudah paham STDDEV? Latih langsung di browser
Latihan interaktif, langsung di browser.