IniziaInizia gratis

Groups of customers

Use the CUBE operator to extract the content of a pivot table from the database. Create a table with the total number of male and female customers from each country.

Questo esercizio fa parte del corso

Data-Driven Decision Making in SQL

Visualizza il corso

Istruzioni dell'esercizio

  • Create a table with the total number of customers, of all female and male customers, of the number of customers for each country and the number of men and women from each country.

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

SELECT ___, -- Extract information of a pivot table of gender and country for the number of customers
	   ___,
	   ___
FROM customers
GROUP BY CUBE (___, ___)
ORDER BY country;
Modifica ed esegui il codice