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

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

database_leetcode 2004. The Number of Seniors and Juniors to Joi

2022-02-22 14:02 作者:您是打尖兒還是住店呢  | 我要投稿

Table: Candidates


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

| Column Name | Type |

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

| employee_id | int ?|

| experience ?| enum |

| salary ? ? ?| int ?|

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

employee_id is the primary key column for this table.

experience is an enum with one of the values ('Senior', 'Junior').

Each row of this table indicates the id of a candidate, their monthly salary, and their experience.

A company wants to hire new employees. The budget of the company for the salaries is $70000. The company's criteria for hiring are:


Hiring the largest number of seniors.

After hiring the maximum number of seniors, use the remaining budget to hire the largest number of juniors.

Write an SQL query to find the number of seniors and juniors hired under the mentioned criteria.


Return the result table in any order.


Candidates table:

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

| employee_id | experience | salary |

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

| 1 ? ? ? ? ? | Junior ? ? | 10000 ?|

| 9 ? ? ? ? ? | Junior ? ? | 10000 ?|

| 2 ? ? ? ? ? | Senior ? ? | 80000 ?|

| 11 ? ? ? ? ?| Senior ? ? | 80000 ?|

| 13 ? ? ? ? ?| Senior ? ? | 80000 ?|

| 4 ? ? ? ? ? | Junior ? ? | 40000 ?|

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

Output:

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

| experience | accepted_candidates |

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

| Senior ? ? | 0 ? ? ? ? ? ? ? ? ? |

| Junior ? ? | 3 ? ? ? ? ? ? ? ? ? |

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

Explanation:

We cannot hire any seniors with the current budget as we need at least $80000 to hire one senior.

We can hire all three juniors with the remaining budget.

其實(shí)關(guān)鍵就是最后一句話;

database_leetcode 2004. The Number of Seniors and Juniors to Joi的評論 (共 條)

分享到微博請遵守國家法律
通城县| 台中市| 岐山县| 台东县| 江门市| 册亨县| 漯河市| 胶州市| 乡宁县| 双鸭山市| 东乡县| 池州市| 南郑县| 开化县| 洮南市| 微山县| 玉环县| 乌鲁木齐市| 桃园县| 商丘市| 阿鲁科尔沁旗| 伊宁县| 河北省| 漠河县| 玉龙| 延长县| 佛学| 抚顺县| 满洲里市| 绥德县| 阳江市| 监利县| 清丰县| 永登县| 册亨县| 新干县| 阆中市| 法库县| 开远市| 留坝县| 拜城县|