Company: Swiggy
Difficulty: medium
Problem Description Write a query to return a single list containing all customers who have never been issued an invoice, and all products that have never been sold (i.e., do not appear in any invoice items). You are required to combine these two result sets using the UNION operator. Schema Table: customer id (int) - Primary Key customer_name (varchar) city_id (int) customer_address (varchar) contact_person (varchar) email (varchar) phone (varchar) Table: product id (int) - Primary Key product_name (varchar) Table: invoice id (int) - Primary Key customer_id (int) - Foreign Key referencing customer.id Table: invoice_item id (int) - Primary Key invoice_id (int) - Foreign Key referencing invoice.id product_id (int) - Foreign Key referencing product.id Required Output Your query should return three columns in the following exact order: record_type : The literal string 'customer' for customer records, and 'product' for product records. id : The corresponding id of the customer or product. n