国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

leetcode2504. Concatenate the Name and the Profession

2022-12-18 16:00 作者:您是打尖兒還是住店呢  | 我要投稿

Description

Table:?Person

+-------------+---------+

| Column Name | Type|?

+-------------+---------+?

| person_id ? |int ? ? |

| name ? ? ? ?| varchar |?

| profession ?| ENUM ? ?|?

+-------------+---------+?

person_id is the primary key for this table. Each row in this table contains a person's ID, name, and profession. The profession ? column in an enum of the type ('Doctor', 'Singer', 'Actor', 'Player', 'Engineer', or 'Lawyer')

?

Write an SQL query to report each person's name followed by the first letter of their profession enclosed in parentheses.

Return the result table?ordered?by?person_id?in?descending order.

The query result format is shown in the following example.

?

Example 1:

Input: Person table:?

+-----------+-------+------------+?

| person_id | name ?| profession |?

+-----------+-------+------------+?

| 1 ? ? ? ? | Alex ?| Singer ? ? |

| 3 ? ? ? ? | Alice | Actor ? ? ?|?

| 2 ? ? ? ? | Bob ? | Player ? ? |?

| 4 ? ? ? ? | Messi | Doctor ? ? |?

| 6 ? ? ? ? | Tyson | Engineer ? |?

| 5 ? ? ? ? | Meir ?| Lawyer ? ? |?

+-----------+-------+------------+

Output:?

+-----------+----------+?

| person_id | name ? ? |

+-----------+----------+?

| 6 ? ? ? ? | Tyson(E) |?

| 5 ? ? ? ? | Meir(L) ?|?

| 4 ? ? ? ? | Messi(D) |?

| 3 ? ? ? ? | Alice(A) |?

| 2 ? ? ? ? | Bob(P) ? |?

| 1 ? ? ? ? | Alex(S) ?|?

+-----------+----------+

Explanation: Note that there should not be any white space between the name and the first letter of the profession.

Easy?

person_id name

6 Tyson(E)

5 Meir(L)

4 Messi(D)

3 Alice(A)

2 Bob(P)

1 Alex(S)


leetcode2504. Concatenate the Name and the Profession的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
婺源县| 台湾省| 陆川县| 呼和浩特市| 清流县| 定日县| 阜城县| 滨州市| 黄龙县| 清徐县| 诏安县| 西林县| 白银市| 西昌市| 高碑店市| 县级市| 哈巴河县| 溧水县| 资兴市| 自贡市| 巴塘县| 天津市| 平泉县| 大兴区| 如皋市| 双城市| 阿荣旗| 柏乡县| 彭水| 孟连| 礼泉县| 长顺县| 普宁市| 赤壁市| 繁昌县| 榆社县| 高陵县| 岑溪市| 闸北区| 女性| 玉溪市|