Cloud Storage Limit

ASKED IN INTERVIEW
2pts
Adobe

Problem Statement

Adobe Creative Cloud provides users with a 20GB storage limit. To improve user experience, the system needs to identify power users who are nearing their limit so they can receive a notification to upgrade.

Write an SQL query to find all users who have used 90% or more of their 20GB storage.

Rules:

  • Total capacity is fixed at 20GB.
  • Usage percentage is calculated as (storage_used_gb / 20.0) * 100.
  • Only include users where the usage percentage is >= 90.
  • Output columns: user_id, storage_used_gb, usage_percentage.
  • Sort the results by usage_percentage in descending order.

Table Schema:

  • UserStorage: user_id, storage_used_gb (DECIMAL), last_sync_at.
Tests your understanding of
Basic SQL, Arithmetic and Filtering

Input Tables

UserStorage
user_id(INTEGER)storage_used_gb(DECIMAL)
10118.5
10215
10319.8
10417.9
10518
1065.2

Expected Output

user_id(INTEGER)storage_used_gb(DECIMAL)usage_percentage(DECIMAL)
10319.899
10118.592.5
1051890

Tags

EasyASKED IN INTERVIEWBasic SQLArithmeticFiltering
10 min
76%

Hints