Write SQL and Python, run instantly in your browser, and track your progress.
You are a Data Engineer at Target. The product catalog stores is_active as 0/1 integers, but the analytics team needs boolean values for their filtering logic. Convert the is_active column to boolean type and add a readable status column.
| Column Name | Type |
|---|---|
| product_id | int64 |
| sku | object |
| product_name | object |
| category | object |
You are a Data Engineer at Target. The product catalog stores is_active as 0/1 integers, but the analytics team needs boolean values for their filtering logic. Convert the is_active column to boolean type and add a readable status column.
| Column Name | Type |
|---|---|
| product_id | int64 |
| sku | object |
| product_name | object |
| category | object |
| price | float64 |
| price | float64 |
| currency | object |
| currency | object |
| is_active | int64 |
| is_active | int64 |
| weight_kg | float64 |
| weight_kg | float64 |
| created_at | object |
| created_at | object |
| product_id | sku | product_name | category | price | currency | is_active | weight_kg | created_at |
|---|---|---|---|---|---|---|---|---|
| 1 | SKU-10001 | Casper Original Mattress Queen | Home | 1095.0 | USD |
| product_id | sku | product_name | category | price | currency | is_active | weight_kg | created_at |
|---|---|---|---|---|---|---|---|---|
| 1 | SKU-10001 | Casper Original Mattress Queen | Home | 1095.0 | USD |
| product_id | sku | product_name | category | price | currency | is_active | weight_kg | created_at | is_active_bool | active_status |
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | SKU-10001 | Casper Original Mattress Queen | Home | 1095 | USD | 1 | 31.75 | 2025-02-14 10:57:38 |
| product_id | sku | product_name | category | price | currency | is_active | weight_kg | created_at | is_active_bool | active_status |
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | SKU-10001 | Casper Original Mattress Queen | Home | 1095 | USD | 1 | 31.75 | 2025-02-14 10:57:38 |
Showing first 5 of 50 rows.
Showing first 5 of 50 rows.
1. Data Selection:
2. Type Conversion:
3. Output:
1. Data Selection:
2. Type Conversion:
3. Output:
| 1 |
| 1 |
| 31.75 |
| 31.75 |
| 2025-02-14 10:57:38 |
| 2025-02-14 10:57:38 |
| 2 | SKU-10002 | Dyson Supersonic Hair Dryer | Beauty | 429.99 | USD | 1 | 0.66 | 2025-02-27 07:20:29 |
| 2 | SKU-10002 | Dyson Supersonic Hair Dryer | Beauty | 429.99 | USD | 1 | 0.66 | 2025-02-27 07:20:29 |
| 3 | SKU-10003 | CalDigit TS4 Thunderbolt Dock | Office | 399.99 | USD | 1 | 0.5 | 2024-12-11 00:49:57 |
| 3 | SKU-10003 | CalDigit TS4 Thunderbolt Dock | Office | 399.99 | USD | 1 | 0.5 | 2024-12-11 00:49:57 |
| 4 | SKU-10004 | Under Armour Tech 2.0 T-Shirt | Sports | 25.0 | USD | 1 | 0.15 | 2024-11-22 04:49:00 |
| 4 | SKU-10004 | Under Armour Tech 2.0 T-Shirt | Sports | 25.0 | USD | 1 | 0.15 | 2024-11-22 04:49:00 |
| 14 | SKU-10014 | It Ends with Us by Colleen Hoover | Books | 16.99 | USD | 0 | 0.32 | 2024-09-13 01:13:13 |
| 14 | SKU-10014 | It Ends with Us by Colleen Hoover | Books | 16.99 | USD | 0 | 0.32 | 2024-09-13 01:13:13 |
| True |
| True |
| Active |
| Active |
| 2 | SKU-10002 | Dyson Supersonic Hair Dryer | Beauty | 429.99 | USD | 1 | 0.66 | 2025-02-27 07:20:29 | True | Active |
| 2 | SKU-10002 | Dyson Supersonic Hair Dryer | Beauty | 429.99 | USD | 1 | 0.66 | 2025-02-27 07:20:29 | True | Active |
| 3 | SKU-10003 | CalDigit TS4 Thunderbolt Dock | Office | 399.99 | USD | 1 | 0.50 | 2024-12-11 00:49:57 | True | Active |
| 3 | SKU-10003 | CalDigit TS4 Thunderbolt Dock | Office | 399.99 | USD | 1 | 0.50 | 2024-12-11 00:49:57 | True | Active |
| 4 | SKU-10004 | Under Armour Tech 2.0 T-Shirt | Sports | 25 | USD | 1 | 0.15 | 2024-11-22 04:49:00 | True | Active |
| 4 | SKU-10004 | Under Armour Tech 2.0 T-Shirt | Sports | 25 | USD | 1 | 0.15 | 2024-11-22 04:49:00 | True | Active |
| 5 | SKU-10005 | Staples TRU RED Copy Paper 10-Ream | Office | 54.99 | USD | 1 | 22.68 | 2025-01-10 01:43:59 | True | Active |
| 5 | SKU-10005 | Staples TRU RED Copy Paper 10-Ream | Office | 54.99 | USD | 1 | 22.68 | 2025-01-10 01:43:59 | True | Active |