Menghitung sample variance dari nilai numerik. Menggunakan N-1 sebagai pembagi (Bessel's correction) untuk estimasi variance populasi dari sample.
FLOATDiperbarui: 6 Jan 2026VAR_SAMP(expression)Kolom atau ekspresi numerik yang akan dihitung variansnya
1 SELECT 2 region, 3 COUNT(*) as sample_size, 4 ROUND(AVG(satisfaction_score), 2) as avg_score, 5 ROUND(VAR_SAMP(satisfaction_score), 2) as score_variance 6 FROM customer_survey 7 GROUP BY region;
Survey adalah sample, jadi gunakan VAR_SAMP untuk estimasi variance populasi.
| REGION | SAMPLE_SIZE | AVG_SCORE | SCORE_VARIANCE |
|---|---|---|---|
| APAC | 500 | 4.2 | 0.85 |
| EMEA | 450 | 4.0 | 1.10 |
| AMERICAS | 600 | 4.5 | 0.65 |
1 SELECT 2 VAR_SAMP(price) as variance, 3 STDDEV_SAMP(price) as stddev, 4 SQRT(VAR_SAMP(price)) as stddev_from_var, 5 POWER(STDDEV_SAMP(price), 2) as var_from_stddev 6 FROM products;
Menunjukkan hubungan matematis: VARIANCE = STDDEV^2.
Sudah paham VAR_SAMP? Latih langsung di browser
Latihan interaktif, langsung di browser.
MODE