From 6b1ab3cba0b2280757e89da262c24c88c92b20a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Antonio=20Chac=C3=B3n=20Guti=C3=A9rrez?= <138903866+joseantoniochacon@users.noreply.github.com> Date: Mon, 30 Sep 2024 14:05:57 -0600 Subject: [PATCH] Create README - LeetHub --- 1907-count-salary-categories/README.md | 55 ++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 1907-count-salary-categories/README.md diff --git a/1907-count-salary-categories/README.md b/1907-count-salary-categories/README.md new file mode 100644 index 0000000..3dc1896 --- /dev/null +++ b/1907-count-salary-categories/README.md @@ -0,0 +1,55 @@ +

1907. Count Salary Categories

Medium


SQL Schema

Table: Accounts

+ +
+-------------+------+
+| Column Name | Type |
++-------------+------+
+| account_id  | int  |
+| income      | int  |
++-------------+------+
+account_id is the primary key (column with unique values) for this table.
+Each row contains information about the monthly income for one bank account.
+
+ +

 

+ +

Write a solution to calculate the number of bank accounts for each salary category. The salary categories are:

+ + + +

The result table must contain all three categories. If there are no accounts in a category, return 0.

+ +

Return the result table in any order.

+ +

The result format is in the following example.

+ +

 

+

Example 1:

+ +
Input: 
+Accounts table:
++------------+--------+
+| account_id | income |
++------------+--------+
+| 3          | 108939 |
+| 2          | 12747  |
+| 8          | 87709  |
+| 6          | 91796  |
++------------+--------+
+Output: 
++----------------+----------------+
+| category       | accounts_count |
++----------------+----------------+
+| Low Salary     | 1              |
+| Average Salary | 0              |
+| High Salary    | 3              |
++----------------+----------------+
+Explanation: 
+Low Salary: Account 2.
+Average Salary: No accounts.
+High Salary: Accounts 3, 6, and 8.
+
+
\ No newline at end of file