bugfree Icon
interview-course
interview-course
interview-course
interview-course
interview-course
interview-course
interview-course
interview-course

Leetcode Problem 2504. Concatenate the Name and the Profession

2504. Concatenate the Name and the Profession

Leetcode Solutions

Concatenating Profession Initial with Name

  1. Select the person_id column as is.
  2. Use the CONCAT function to combine the name column with the first letter of the profession column, which is obtained using the LEFT function, and enclose this letter in parentheses.
  3. Alias the concatenated string as name.
  4. Order the results by person_id in descending order to meet the output requirement.

erDiagram
    Person {
        int person_id
        varchar name
        ENUM profession
    }

Ask Question

Programming Language
image/screenshot of info(optional)
Full Screen
Loading...

Suggested Answer

Answer
Full Screen
Copy Answer Code
Loading...