Task: Text to Code
Input (English): Step 1: For each row in Invoices table, find the corresponding rows in Invoice_Items table.
Step 2: find the average Invoice_Items's Order_Quantity in the results of step 1 whose payment_method_code equals MasterCard
Output (English): SELECT Avg ( T2.Order_Quantity ) FROM Invoices AS T1 JOIN Invoice_Items AS T2 ON T1.Invoice_ID = T2.Invoice_ID WHERE T1.payment_method_code = "MasterCard"