r/learnSQL • • Jul 27 '26

Entering Missing Values After Deducing Them

Hello everyone, I am practicing data cleaning and I have a question.

Let's say I have a table where the columns are Customer_ID and Email. The "Customer_ID" column has no blank values, but the "Email" column has hundreds of blank values.

Looking through the data, I noticed that the email addresses are just 'user' followed by the Customer_ID number. For example, if the Customer_ID is C1 then the email would be user1@example.com. Or if the Customer_ID is C10 then the email would be user10@example.com.

Is there a query I can run to fill in all the missing email addresses?

Thank you

3 Upvotes

5 comments sorted by

View all comments

Show parent comment

1

u/nerd_airfryer Jul 27 '26

Syntax might differ depending on the engine, but the idea is same, concatenate (user + number in customer id after the 'C' character + @example.com)