Order Tagging

ASKED IN INTERVIEW
2pts
Shopify

Problem Statement

Shopify merchants use tags to organize fulfillment. A specific workflow requires identifying orders that are particularly sensitive: those tagged as both High Value and Urgent.

Write an SQL query to find the order IDs that contain both of these tags.

Rules:

  • An order must have both High Value and Urgent tags to be included.
  • Output columns: order_id.
  • Results must be returned in ascending order by order_id.

Table Schema:

  • OrderTags: tag_id, order_id, tag_name (VARCHAR).
Tests your understanding of
Basic SQL, Aggregation, Filtering and Subqueries

Input Tables

OrderTags
order_id(INTEGER)tag_name(VARCHAR)
1001High Value
1001Urgent
1002High Value
1003Urgent
1004High Value
1004Urgent
1004International
1005Fragile

Expected Output

order_id(INTEGER)
1001
1004

Tags

EasyASKED IN INTERVIEWBasic SQLAggregationFilteringSubqueries
10-15 min
72%

Hints