Create a MySQL table for Paddle CSV export + product count

CREATE TABLE IF NOT EXISTS paddle (
joined_id int(10) NOT NULL,
product_name varchar(255) DEFAULT NULL,
customer_email varchar(255) DEFAULT NULL,
order_total varchar(255) DEFAULT NULL,
paddle_fee varchar(255) DEFAULT NULL,
vat_amount varchar(255) DEFAULT NULL,
currency_code varchar(255) DEFAULT NULL,
country varchar(255) DEFAULT NULL,
date varchar(255) DEFAULT NULL,
coupon_code varchar(255) DEFAULT NULL,
PRIMARY KEY (joined_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

To import the Paddle CSV in phpMyAdmin, delete first row (column names), then use CSV using LOAD DATA from the drop down menu:

SELECT product_name, COUNT(product_name) as count FROM paddle
GROUP BY product_name
ORDER BY count DESC

To filter by year
SELECT product_name, COUNT(product_name) as count FROM paddle WHERE date LIKE '%16 %'
GROUP BY product_name
ORDER BY count DESC

To change the Date format in Excel to match MySQL use Custom:
Right click on the date column ->
Format Cells ->
Custom
yyyy-m-d h:mm:ss

Leave a Reply

Your email address will not be published. Required fields are marked *