Hi! Could we please enable some services and cookies to improve your experience and our website?

SQLize | PHPize | SQLtest

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

A A A
Login    Share code      Blog   FAQ
Copy Format Clear
CREATE TABLE DataPizza ( ID INTEGER, Tanggal TEXT, Nama_Pizza TEXT, Kategori TEXT, Harga INTEGER, Jumlah INTEGER, Total INTEGER ); INSERT INTO DataPizza (ID, Tanggal, Nama_Pizza, Kategori, Harga, Jumlah, Total) VALUES (1, '2024-06-01', 'Pepperoni', 'Classic', 50000, 2, 100000), (2, '2024-06-01', 'Veggie Deluxe', 'Veggie', 45000, 1, 45000), (3, '2024-06-02', 'Meat Lovers', 'Supreme', 60000, 3, 180000), (4, '2024-06-02', 'Cheese Mania', 'Cheese', 40000, 2, 80000), (5, '2024-06-03', 'Pepperoni', 'Classic', 50000, 1, 50000), (6, '2024-06-03', 'Veggie Deluxe', 'Veggie', 45000, 2, 90000), (7, '2024-06-04', 'Meat Lovers', 'Supreme', 60000, 1, 60000), (8, '2024-06-04', 'Cheese Mania', 'Cheese', 40000, 1, 40000), (9, '2024-06-05', 'Pepperoni', 'Classic', 50000, 4, 200000), (10, '2024-06-05', 'Veggie Deluxe', 'Veggie', 45000, 2, 90000); SELECT * FROM DataPizza; -- Total penjualan per kategori SELECT Kategori, SUM(Total) AS Total_Pendapatan FROM DataPizza GROUP BY Kategori;

Stuck with a problem? Got Error? Ask AI support!

Copy Clear