Q:

Write a mysql statement to find the concatenated first_name, last_name where age of the employee is greater than 30

belongs to collection: MySQL Exercises

0

Write a mysql statement to find the concatenated first_name, last_name where age of the employee is greater than 30

Suppose the employee table is -

 
+------------------------+------------------------------+----------+----------+
| first_name             | last_name                    | age      | dept     |
+------------------------+------------------------------+----------+----------+
| Mesa                   | Loop                         |  30      |  Acct    |
| Smith                  | Oak                          |  27      |  Devl    | 
| John                   | Jorz                         |  37      |  QA      | 
| Hary                   | Gaga                         |  32      |  QA      | 
+------------------------+------------------------------+----------+----------+

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Solution

The following statement returns the concatenated first_name, last_name of the employees whose age is greater than 30.

mysql> SELECT CONCAT(first_name, ' ', last_name) FROM employee WHERE age > 30;

Output of the above code -

+-----------+
| John Jorz | 
| Hary Gaga |
+-----------+

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

MySQL Exercises

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Write a mysql statement to get user, current date ... >>