VARIANCE: population standard variance

VARIANCE() Query MySQL aggregate function VARIANCE() returns population standard variance of the input field / data. It returns NULL if no matching row is found.

VARIANCE() is synonym of the SQL function VAR_POP().
VAR_SAMP() returns the sample variance .

Here are some examples using our student table.



SELECT  VARIANCE(mark),VAR_POP(mark), VAR_SAMP(mark) FROM `student`
Output is here
VARIANCE(mark)VAR_POP(mark)VAR_SAMP(mark)
272.1728395061727272.1728395061727282.6410256410255

By using FORMAT()

Restrict decimal places by using FORMAT()

SELECT  FORMAT(VARIANCE(mark),2) FROM `student`
Output is here
FORMAT(VARIANCE(mark),2)
272.17
SQL Math References Standard deviation Average value Query
Subhendu Mohapatra — author at plus2net
Subhendu Mohapatra

Author

🎥 Join me live on YouTube

Passionate about coding and teaching, I publish practical tutorials on PHP, Python, JavaScript, SQL, and web development. My goal is to make learning simple, engaging, and project‑oriented with real examples and source code.



Subscribe to our YouTube Channel here



plus2net.com




SQL Video Tutorials










We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
©2000-2025   plus2net.com   All rights reserved worldwide Privacy Policy Disclaimer