Given an API, fetch data and render it in a table (React)
Asked in the Round 1 stage. Assume the API response is generated from the provided PostgreSQL tables. Write a SQL query that returns the records needed for the table.
product_id, product_name, category_name, price, and updated_at.Uncategorized.product_name ascending, then product_id ascending.| Column | Type | Description |
|---|---|---|
| product_idPK | INT | Unique product identifier |
| product_name | VARCHAR(150) | Product name displayed in the API table |
| category_id | INT | Referenced category identifier |
| price | DECIMAL(10,2) | Current product price |
| updated_at | TIMESTAMP | Timestamp of the latest product update |
| is_active | BOOLEAN | Whether the product is active |
| api_visible | BOOLEAN | Whether the product may appear in the API response |
| Column | Type | Description |
|---|---|---|
| category_idPK | INT | Unique category identifier |
| category_name | VARCHAR(100) | Category display name |