Using ROUND()
Aggregate functions work great with numerical values; however, these results can sometimes get unwieldy when dealing with long decimal values. Luckily, SQL provides you with the ROUND() function to tame these long decimals.
If asked to give the average budget of your films, ten decimal places is not necessary. Instead, you can round to two decimal places to create results that make more sense for currency.
Now you try!
Latihan ini merupakan bagian dari kursus
Intermediate SQL
Instruksi latihan
- Calculate the average
facebook_likesto one decimal place and assign to the alias,avg_facebook_likes.
Latihan interaktif langsung praktik
Cobalah latihan ini dengan melengkapi kode contoh ini.
-- Round the average number of facebook_likes to one decimal place
___