Prime Shipping Eligibility

ASKED IN INTERVIEW
2pts
Amazon

Problem Statement

Amazon Prime shipping costs are optimized when products are lightweight but have a higher profit margin. The logistics team needs a list of all products that weigh less than 5lbs and have a retail price greater than $20.

Write an SQL query to identify these eligible products.

Rules:

  • The weight must be strictly less than 5.
  • The price must be strictly greater than 20.
  • Output columns: product_id, product_name, price.
  • Sort the results by price in descending order.

Table Schema:

  • Products: product_id, product_name, category, weight, price.
Tests your understanding of
Basic SQL, Filtering and Logical Operators

Input Tables

Products
product_id(INTEGER)product_name(VARCHAR)weight(DECIMAL)price(DECIMAL)
1Wireless Mouse0.525
2Gaming Chair45199
3USB-C Cable0.212
4Mechanical Keyboard385
5Desk Lamp4.930
6Heavy Doorstop622

Expected Output

product_id(INTEGER)product_name(VARCHAR)price(DECIMAL)
4Mechanical Keyboard85
5Desk Lamp30
1Wireless Mouse25

Tags

EasyASKED IN INTERVIEWBasic SQLFilteringLogical Operators
5 min
88%

Hints