-- Database schema
| Ref_Payment_Methods : payment_method_code [ TEXT ] primary_key , payment_method_description [ TEXT ] | Ref_Service_Types : Service_Type_Code [ TEXT ] primary_key , Parent_Service_Type_Code [ TEXT ] , Service_Type_Description [ TEXT ] | Addresses : Address_ID [ TEXT ] primary_key , Line_1 [ TEXT ] , Line_2 [ TEXT ] , City_Town [ TEXT ] , State_County [ TEXT ] , Other_Details [ TEXT ] | Products : Product_ID [ TEXT ] primary_key , Product_Name [ TEXT ] , Product_Price [ INT ] , Product_Description [ TEXT ] , Other_Product_Service_Details [ TEXT ] | Marketing_Regions : Marketing_Region_Code [ TEXT ] primary_key , Marketing_Region_Name [ TEXT ] , Marketing_Region_Descriptrion [ TEXT ] , Other_Details [ TEXT ] | Clients : Client_ID [ INT ] primary_key , Address_ID [ INT ] Clients.Address_ID = Addresses.Address_ID , Customer_Email_Address [ TEXT ] , Customer_Name [ TEXT ] , Customer_Phone [ TEXT ] , Other_Details [ TEXT ] | Drama_Workshop_Groups : Workshop_Group_ID [ INT ] primary_key , Address_ID [ INT ] Drama_Workshop_Groups.Address_ID = Addresses.Address_ID , Currency_Code [ TEXT ] , Marketing_Region_Code [ TEXT ] , Store_Name [ TEXT ] , Store_Phone [ TEXT ] , Store_Email_Address [ TEXT ] , Other_Details [ TEXT ] | Performers : Performer_ID [ INT ] primary_key , Address_ID [ INT ] Performers.Address_ID = Addresses.Address_ID , Customer_Name [ TEXT ] , Customer_Phone [ TEXT ] , Customer_Email_Address [ TEXT ] , Other_Details [ TEXT ] | Customers : Customer_ID [ TEXT ] primary_key , Address_ID [ INT ] Customers.Address_ID = Addresses.Address_ID , Customer_Name [ TEXT ] , Customer_Phone [ TEXT ] , Customer_Email_Address [ TEXT ] , Other_Details [ TEXT ] | Stores : Store_ID [ TEXT ] primary_key , Address_ID [ INT ] Stores.Address_ID = Addresses.Address_ID , Marketing_Region_Code [ TEXT ] Stores.Marketing_Region_Code = Marketing_Regions.Marketing_Region_Code , Store_Name [ TEXT ] , Store_Phone [ TEXT ] , Store_Email_Address [ TEXT ] , Other_Details [ TEXT ] | Bookings : Booking_ID [ INT ] primary_key , Customer_ID [ INT ] Bookings.Customer_ID = Clients.Client_ID , Workshop_Group_ID [ TEXT ] Bookings.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID , Status_Code [ TEXT ] , Store_ID [ INT ] , Order_Date [ TEXT ] , Planned_Delivery_Date [ TEXT ] , Actual_Delivery_Date [ TEXT ] , Other_Order_Details [ TEXT ] | Performers_in_Bookings : Order_ID [ INT ] primary_key Performers_in_Bookings.Order_ID = Bookings.Booking_ID , Performer_ID [ INT ] Performers_in_Bookings.Performer_ID = Performers.Performer_ID | Customer_Orders : Order_ID [ INT ] primary_key , Customer_ID [ INT ] Customer_Orders.Customer_ID = Customers.Customer_ID , Store_ID [ INT ] Customer_Orders.Store_ID = Stores.Store_ID , Order_Date [ TEXT ] , Planned_Delivery_Date [ TEXT ] , Actual_Delivery_Date [ TEXT ] , Other_Order_Details [ TEXT ] | Order_Items : Order_Item_ID [ INT ] primary_key , Order_ID [ INT ] Order_Items.Order_ID = Customer_Orders.Order_ID , Product_ID [ INT ] Order_Items.Product_ID = Products.Product_ID , Order_Quantity [ TEXT ] , Other_Item_Details [ TEXT ] | Invoices : Invoice_ID [ INT ] primary_key , Order_ID [ INT ] Invoices.Order_ID = Customer_Orders.Order_ID , payment_method_code [ TEXT ] Invoices.payment_method_code = Ref_Payment_Methods.payment_method_code , Product_ID [ INT ] , Order_Quantity [ TEXT ] , Other_Item_Details [ TEXT ] , Order_Item_ID [ INT ] | Services : Service_ID [ INT ] primary_key , Service_Type_Code [ TEXT ] Services.Service_Type_Code = Ref_Service_Types.Service_Type_Code , Workshop_Group_ID [ INT ] Services.Workshop_Group_ID = Drama_Workshop_Groups.Workshop_Group_ID , Product_Description [ TEXT ] , Product_Name [ TEXT ] , Product_Price [ INT ] , Other_Product_Service_Details [ TEXT ] | Bookings_Services : Order_ID [ INT ] primary_key Bookings_Services.Order_ID = Bookings.Booking_ID , Product_ID [ INT ] Bookings_Services.Product_ID = Services.Service_ID | Invoice_Items : Invoice_Item_ID [ INT ] primary_key , Invoice_ID [ INT ] Invoice_Items.Invoice_ID = Invoices.Invoice_ID , Order_ID [ INT ] Invoice_Items.Order_ID = Bookings_Services.Order_ID , Order_Item_ID [ INT ] Invoice_Items.Order_Item_ID = Order_Items.Order_Item_ID , Product_ID [ INT ] Invoice_Items.Product_ID = Bookings_Services.Product_ID , Order_Quantity [ INT ] , Other_Item_Details [ TEXT ] |
-- -- Show all payment method codes and the number of orders for each code.

SELECT payment_method_code ,  count(*) FROM INVOICES GROUP BY payment_method_code;