Project to update domain and userid part of email address.
We have one table with subscribers email address in one column, we have another two columns domain & userid with NULL data. We have to develop a single query to update these two columns by domain and userid part of the email address.
The SQL dump of the table ( plus2net_newsletter ) is available at end of this tutorial. Use that to create table with four records. There are four records with sample data and all have NULL data for userid and domain columns.
Using string functions we will separate domain and uesrid part from email address and then update the respective columns in a MySQL table.
For better understanding of the final query, we will test first with small quires and check the outputs.