SG Analytics needs a transaction extract for validating activity reported through its analytics dashboards. Write a PostgreSQL query that joins orders to customers and products, returning transactions from February 1, 2024 through February 29, 2024.
Requirements
- Use
orders as the primary table and retain orders even when the customer or product has no matching record.
- Return the order ID, order date, customer details, product details, quantity, unit price, and calculated line total.
- Label each row as
positive, zero, or negative based on the calculated line total.
- Sort the results by order date ascending and order ID ascending.