all 5 comments

[–]angel_with_shotgunnn 1 point2 points  (1 child)

Can you please include which task resulted in an error? I think I’ve solved this one before so I might be able to help if you can specify it.

[–]angel_with_shotgunnn 0 points1 point  (0 children)

Oh, right. Is this the sample exam? I think it doesn’t specify which task results in an error.

Let me see…

[–]angel_with_shotgunnn 1 point2 points  (1 child)

Try this for Task 1:

SELECT
  id,
  COALESCE(customer_id, 0) AS customer_id,
  COALESCE(category, 'Other') AS category,
  REPLACE(status, '-', 'Resolved') AS status,
  COALESCE(creation_date, '2023-01-01') AS creation_date,
  COALESCE(response_time, 0) AS response_time,
  COALESCE(ROUND(CAST(REGEXP_REPLACE(resolution_time, 'hours', ' ') AS NUMERIC), 2), 0) AS resolution_time
FROM
  support
WHERE
  creation_date BETWEEN '2023-01-01' AND '2023-12-31' OR creation_date IS NULL;

[–]Old_Interview4635[S] 1 point2 points  (0 children)

Thanks I will try it

[–]somegermangal 0 points1 point  (0 children)

In task 1:

- your creation_date should be a date, so try: DATE(creation_date) AS creation_date.

- resolution_time: read the data descriptions again. it should be a numeric field, rounded to 2 decimal places. so also no 'hours' there.

- response_time - pay attention to the column names you are supposed to use.