QUESTION

Text
Image


Using MySQL, write a query to retrieve a list of all customer ids, names, and phone numbers, with their country codes concatenated with their phone numbers. Sort the output in the order of their customer_id. There are two tables in the database: 1) customers $\rightarrow$ Contains customer_id, name, phone_number, and country. 2) country_codes $\rightarrow$ opntains the country code for every country. Example: \begin{tabular}{|c|c|c|c|} \hline \multicolumn{4}{|c|}{ customers } \\ \hline curtomer jid & nsme & phone,number & country \\ \hline 1 & Faghsu & 951341341 & Indla \\ \hline 2 & Jake & 52341351 & USA \\ \hline 3 & Alice & 61341351 & USA \\ \hline \end{tabular} \begin{tabular}{|c|c|} \hline \multicolumn{2}{|c|}{ country_codes } \\ \hline country & country_code \\ \hline USA & 1 \\ \hline indis & 91 \\ \hline \end{tabular} Sample Output Explanation: - Since Raghav is from India, the country code is 91 , so the complete phone number is $+91951341341$ - Since Jake is from the USA, the country code is 1 , and the complete phone number is $+152341351$ - Since Alice is from the USA, the country code is 1 , and the complete phone number is $+161341351$ Note: The phone number should be in the following format: +COUNTRY_CODE PHONENUMBER (without spaces)

Public Answer

4CFOVY The First Answerer