Company: ZomatoPA_IITK
Difficulty: medium
Problem Description Zomato encountered an issue with their delivery system. Due to an error in the delivery driver instructions, the order ID for each item was mistakenly swapped with the item in the subsequent row. Specifically, the order ID of an item in an odd-numbered row was swapped with the order ID of the item in the following even-numbered row (e.g., row 1's order ID was swapped with row 2's, row 3's with row 4's, and so on). As a data analyst, you are asked to write a query to correct this swapping error and return the proper pairing of the order ID and the item. If the last item has an odd order ID (meaning there is no subsequent row to swap with), it should remain unchanged in the corrected data. Schema orders Table: Column Name Type Description order_id INTEGER The unique ID of each Zomato order. item VARCHAR The name of the food item in the order. Required Output Your query should return the following columns: corrected_order_id : The corrected integer ID for the order. it