ComeçarComece de graça

Manipulating numeric data

In this exercise, you are going to use some common SQL Server functions to manipulate numeric data.

You are going to use the ratings table, which stores information about each company that has been rated, their different cocoa beans and the rating per bean.

You are going to find out information like the highest, lowest, average score received by each company (using functions like MAX(), MIN(), AVG()). Then, you will use some rounding functions to present this data with fewer decimals (ROUND(), CEILING(), FLOOR()).

Este exercício faz parte do curso

Functions for Manipulating Data in SQL Server

Ver curso

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

SELECT 
	company, 
    -- Select the number of cocoa flavors for each company
	___(*) AS flavors,
    -- Select the minimum, maximum and average rating
	___ AS lowest_score,
	___ AS highest_score,
	___ AS avg_score	  
FROM ratings
GROUP BY company
ORDER BY flavors DESC;
Editar e executar o código