MulaiMulai sekarang secara 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.

Latihan ini adalah bagian dari kursus

Data-Driven Decision Making in SQL

Lihat Kursus

Petunjuk latihan

  • 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.

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

SELECT ___, -- Extract information of a pivot table of gender and country for the number of customers
	   ___,
	   ___
FROM customers
GROUP BY CUBE (___, ___)
ORDER BY country;
Edit dan Jalankan Kode