CBSE Class 12 Informatics Practices Question 7 of 24

MySQL Functions — Question 7

Back to all questions
7
Question

Question 3(i)

What will be the output of following code ?

mysql> SELECT CONCAT(CONCAT('Inform', 'atics'), 'Practices');
Answer
Output
+------------------------------------------------+
| CONCAT(CONCAT('Inform', 'atics'), 'Practices') |
+------------------------------------------------+
| InformaticsPractices                           |
+------------------------------------------------+
Explanation

The CONCAT() function in SQL is used to concatenate two or more strings into a single string. In this query, the inner CONCAT('Inform', 'atics') concatenates 'Inform' and 'atics' to produce 'Informatics'. The outer CONCAT() then concatenates 'Informatics' with 'Practices' to produce 'InformaticsPractices'. Therefore, the final output is 'InformaticsPractices'.