Problem Statement

Write a Python script that reads data from a JSON file `orders.json`, transforms it, and loads it into a SQLite database. The JSON has this structure: [ {"order_id": 1, "customer": "Alice", "items": ["Laptop", "Mouse"], "total": 51500}, {"order_id": 2, "customer": "Bob", "items": ["Keyboard"], "total": 3000} ] Your pipeline should: 1. Read and parse the JSON file 2. Create a SQLite database `orders.db` with an `orders` table 3. Transform: convert the items list to a comma-separated string 4. Insert all records into the table 5. Query and print all rows to verify the load 6. Print total records inserted

Sample Data

orders.json:
[
  {"order_id": 1, "customer": "Alice", "items": ["Laptop", "Mouse"], "total": 51500},
  {"order_id": 2, "customer": "Bob",   "items": ["Keyboard"],        "total": 3000},
  {"order_id": 3, "customer": "Carol", "items": ["Monitor", "HDMI"], "total": 22000}
]

Expected Output

orders table: (1, 'Alice', 'Laptop,Mouse', 51500)
              (2, 'Bob', 'Keyboard', 3000)
              (3, 'Carol', 'Monitor,HDMI', 22000)
Total records inserted: 3

Your Submission

ℹ️ The AI reads and reviews your code — it does not run it. Runtime errors like missing files or wrong paths won't affect your score. Focus on writing clean, correct logic.
Submit your work — choose one or more options
OR
OR