You are dealing with a table called products, which contains product data entered by several data entry operators. Due to inconsistencies in data entry, some of the product_name entries in this table have leading and trailing spaces.
Your goal is to write a SQL query that cleans up these product names by removing any such spaces. The final output should display a list of all the product_id and the cleaned product_name.
products table:
| Column Name | Description |
|---|---|
| product_id | The unique identifier for each product |
| product_name | The name of the product |
| category | The category to which the product belongs |
| cleaned_product_name |
|---|
| 1 | Smartphone |
| 2 | Laptop |
| 3 | Speaker |
You are dealing with a table called products, which contains product data entered by several data entry operators. Due to inconsistencies in data entry, some of the product_name entries in this table have leading and trailing spaces.
Your goal is to write a SQL query that cleans up these product names by removing any such spaces. The final output should display a list of all the product_id and the cleaned product_name.
products table:
| Column Name | Description |
|---|---|
| product_id | The unique identifier for each product |
| product_name | The name of the product |
| category | The category to which the product belongs |
| product_id | cleaned_product_name |
|---|---|
| 1 | Smartphone |
| 2 | Laptop |
| 3 | Speaker |