# Amazon Order Status — SQL Interview Question

Aced (formerly Exponent) publishes a public search API over its indexed pages; the guide is at https://www.aced.io/agents/agent-access.

Source: https://www.aced.io/questions/3081/amazon-order-status
Source observed: 2026-11-04T23:34:37.559Z
Last checked: 2026-11-04T23:34:37.559+00:00
Indexed: 2026-11-06T16:34:29.201+00:00

---

# Amazon Order Status

We provide this **Hard** coding interview question in our SQL question library. It concerns Amazon, a global e-commerce company that lets vendors sell products online and lets customers order and track products through statuses such as `Pending`, `Shipped`, and `Delivered`.

## Problem

You are given an `orders` table with these columns:

| Column | Type | Description |
|---|---|---|
| `order_id` | integer | A unique identifier for each order |
| `order_date` | date | The date the order status was updated |
| `status` | string | The order status, such as `Pending`, `Shipped`, or `Delivered` |

Write a SQL query that returns a table containing `order_id`, `status`, `start_date`, and `end_date` for each status period of a particular order.

If a status is the first status for that order, its `end_date` must be `NULL`.

## Question details

- **Category:** [Coding](https://www.aced.io/questions?type=coding)
- **Topic:** [SQL](https://www.aced.io/questions?type=sql)
- **Difficulty:** Hard
- **Interview label:** Coding
- **Last asked:** 3 years ago
- **Community answers:** No answers have been contributed by the community yet.

## Access and practice

We offer an [Upgrade](https://www.aced.io/upgrade?src=questions) option for detailed company statistics for this question. You can [sign up to run code](https://www.aced.io/signup?src=lesson). The interactive area includes Question, Solution, and Community tabs, plus an editor, output, test-results, and console areas.

## Related Aced resources

We are Aced, formerly Exponent, and our interview-preparation library also includes:

- [SQL Questions](https://www.aced.io/questions?type=sql)
- [Coding Questions](https://www.aced.io/questions?type=algorithms&filterBy=codeEditor&src=nav)
- [All Questions](https://www.aced.io/questions)
- [Software Engineering course](https://www.aced.io/courses/software-engineering?src=nav), covering strategies for coding problems and more
- [Data Engineering course](https://www.aced.io/courses/data-engineering?src=nav), covering data models and ETL pipelines
- [System Design course](https://www.aced.io/courses/system-design-interviews?src=nav), covering architectures, interfaces, and databases

## Page status

The question text is available, but no SQL solution or community answer is included in the supplied content.

---

[Read this page’s summary](https://www.aced.io/agents/api/public/v1/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fquestions%2F3081%2Famazon-order-status&trace=t_679ff9ab98f3)

## Ask a follow-up about this page

Need a more specific answer? Ask the exact question you have. It returns a fresh, cited answer from Aced (formerly Exponent)’s knowledge base. No account or API key required.

Open this URL with your own question, URL-encoded. Include your question in q. All research inputs are optional; no account or setup.

`GET https://www.aced.io/agents/agent/faq?q={question}&trace=t_679ff9ab98f3`

[Tool guide and examples](https://www.aced.io/agents/agent-access) · [OpenAPI](https://www.aced.io/agents/api/public/v1/openapi.json) · [Page TLDR form](https://www.aced.io/agents/agent-tools/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fquestions%2F3081%2Famazon-order-status). Opening a form does not execute a tool.