The code for customerOrders.sql is: DROP VIEW IF EXISTS customerOrders; CREATE OR REPLACE VIEW customerOrders AS SELECT orderNumber, customerName, SUM(quantityOrdered * priceEach) total FROM orderDetails INNER JOIN orders o USING (orderNumber) INNER JOIN customers USING (customerNumber) GROUP BY orderNumber ORDER BY customerName, orderNumber;